vscode-task icon indicating copy to clipboard operation
vscode-task copied to clipboard

VS Code tasks fail with error "Cannot read properties of undefined (reading 'shell')"

Open apgrucza opened this issue 2 years ago • 7 comments

When the extension is enabled, tasks defined in .vscode/tasks.json fail to run. For example:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "echo",
            "type": "shell",
            "command": "echo Hello"
        }
    ]
}

When using the Tasks: Run Task command and selecting the echo task, this error pops up:

Cannot read properties of undefined (reading 'shell')
  • Task version: 3.24.0
  • Operating System: Windows

apgrucza avatar May 21 '23 13:05 apgrucza

Broken in the same way for me as well, on Linux, with the latest snap version of vs code.

ilkka avatar Sep 11 '23 09:09 ilkka

Same for me on native Windows 10 and in WSL2 (Ubuntu 22.04). Is there some workaround available?

shalauko avatar Nov 17 '23 00:11 shalauko

Same for me on native macOS (14.2.1 (23C71)) and VS Code 1.85.1 (Universal).

polamjag avatar Jan 05 '24 08:01 polamjag

Hi! Are there any updates on this?

siberianbot avatar May 17 '24 09:05 siberianbot

I'm using 'code workspace' with multiple project in it. (multiple taskfiles)

I have more than 1 default build task. If I'm being ask by vscode to choose, it fails with the error. If I remove the other tasks and don't have to choose, it work fine.

3uclid3 avatar Jun 09 '24 18:06 3uclid3

Same here. So the extension just breaks the vscode tasks feature and is therefore not usable.

MrVermond avatar Jun 13 '24 09:06 MrVermond

@pd93 Apparently vscode-task extension does break native vscode ability to run tasks (unrelated to taskfile). See them documented at https://code.visualstudio.com/docs/editor/tasks#vscode

When this extension is installed we can see the error described by the OP.

ssbarnea avatar Jun 27 '24 15:06 ssbarnea