microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.82k stars 29.12k forks source link

Tasks in tasks.json do not run on launch #193339

Closed angelogullotta closed 1 year ago

angelogullotta commented 1 year ago

Type: Bug

The tasks in my tasks.json have stopped launching automatically when I open my workspace using VsCode insiders (Windows 11).

I don't have this issue when using the stable release of VSCode on this same PC.

Everything is also working fine when running the same codebase and same tasks.json file on my Mac using VSCode Insiders.

VS Code version: Code - Insiders 1.83.0-insider (bccfade64adb249f57c8fcf03cba41609f76ce5c, 2023-09-15T05:35:16.508Z) OS version: Windows_NT x64 10.0.22621 Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 9 5900X 12-Core Processor (24 x 3700)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|63.93GB (48.31GB free)| |Process Argv|--folder-uri file:///c%3A/Users/ang/dev/ckf --crash-reporter-id 842d87ec-dd4f-495b-8111-20365d86d180| |Screen Reader|no| |VM|0%|
Extensions (56) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-color-picker|Ant|0.0.4 github-markdown-preview|bie|0.3.0 markdown-checkbox|bie|0.4.0 markdown-emoji|bie|0.3.0 markdown-footnotes|bie|0.1.1 markdown-mermaid|bie|1.19.0 markdown-preview-github-styles|bie|2.0.2 markdown-yaml-preamble|bie|0.1.0 firecode|ChF|1.3.0 path-intellisense|chr|2.8.4 dart-code|Dar|3.72.2 flutter|Dar|3.72.0 vscode-eslint|dba|2.4.2 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|14.3.0 prettier-vscode|esb|10.1.0 vscode-highlight|fab|1.9.0 auto-close-tag|for|0.5.14 auto-rename-tag|for|0.1.10 copilot|Git|1.112.420 copilot-chat|Git|0.8.2023091801 vscode-pull-request-github|Git|0.72.0 todo-tree|Gru|0.0.226 dart-data-class-generator|hzg|0.5.4 vscode-peacock|joh|4.2.2 vscode-random|jre|1.11.0 git-graph|mhu|1.30.0 dotenv|mik|1.0.1 vscode-mjml|mjm|1.0.6 vscode-docker|ms-|1.26.0 python|ms-|2023.16.0 vscode-pylance|ms-|2023.9.10 remote-ssh|ms-|0.106.4 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.81.3 powershell|ms-|2023.6.0 remote-explorer|ms-|0.4.1 vscode-flutter-freezed-helper|mth|0.1.0 dartgettersetter|Pet|1.0.2 vscode-versionlens|pfl|1.7.3 material-icon-theme|PKi|4.30.1 dart-data-class-tools|ric|0.5.9 LiveServer|rit|5.7.9 svg-preview|Sim|2.8.3 swdc-vscode|sof|2.7.0 code-spell-checker|str|3.0.1 code-spell-checker-british-english|str|1.3.0 vsfire|tob|1.4.1 errorlens|use|3.13.0 vscode-ltex|val|13.1.0 adb-interface-vscode|vin|0.22.4 vscode-gradle|vsc|3.12.2023091801 vscode-icons|vsc|12.5.0 pretty-ts-errors|yoa|0.5.1 material-theme|zhu|3.16.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 vscod805:30301674 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 py29gd2263:30784851 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 showlangstatbar:30737417 ecj1e332:30687743 pythonfmttext:30716741 fixshowwlkth:30771523 showindicator:30805243 pythongtdpath:30726887 i26e3531:30792625 welcomedialog:30812478 pythonnosmt12:30779711 pythonidxpt:30768918 pythonnoceb:30776497 copilotsettingt:30808721 synctok:30821570 dsvsc013:30777762 dsvsc014:30777825 diffeditorv2:30786206 pythonlinttype:30823781 pythonmhint1:30815193 dsvsc015:30821418 pythontestfixt:30826906 pythonfb280951:30830809 ```
meganrogge commented 1 year ago

any errors in the task output channel or in the dev tools console?

meganrogge commented 1 year ago

I'm on mac and cannot reproduce, pretty odd that this would act differently on windows

angelogullotta commented 1 year ago

Upon opening my project folder, I just get my default, empty terminal window. It doesn't show any previous commands or errors.

No, I don't see anything in the Tasks channel of the Output panel.

In terms of the developer tools console, the only entry that looks like it might be related is the following:

  ERR Cannot read properties of null (reading 'finishShutdown'): TypeError: Cannot read properties of null (reading 'finishShutdown')
    at JSStreamSocket.finishShutdown (node:internal/js_stream_socket:160:12)
    at node:internal/js_stream_socket:147:14
    at processTicksAndRejections (node:internal/process/task_queues:81:21)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at processImmediate (node:internal/timers:447:9)

The tasks run fine when triggered manually via the Command Palette 'Tasks: Run Tasks'.

Also confirming I have the following set: "task.allowAutomaticTasks": "on"

This is what my tasks.json looks like:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Build runner",
      "type": "shell",
      "isBackground": true,
      "command": "dart run build_runner watch --delete-conflicting-outputs",
      "presentation": {
        "reveal": "always",
        "panel": "new",
        "group": "on_start"
      },
      "runOptions": {
        "runOn": "folderOpen"
      },
      "problemMatcher": []
    },
    {
      "label": "Regenerate l10n",
      "type": "shell",
      "isBackground": true,
      "command": "nodemon -x \"flutter gen-l10n\" -w ./lib/src/localisation/app_en.arb",
      "presentation": {
        "reveal": "always",
        "panel": "new",
        "group": "on_start",
        "close": false
      },
      "runOptions": {
        "runOn": "folderOpen"
      },
      "problemMatcher": []
    }
  ]
}

Let me know if there's anything else I can do to get more info.

meganrogge commented 1 year ago

Can you provide your settings.json file and also record a gif of when you run the task and reload the window?

meganrogge commented 1 year ago

I couldn't repro on windows either

meganrogge commented 1 year ago

/duplicate #193475, can now repro. thanks for the report. should be fixed in insider's tomorrow.