VS Code tasks fail with error "Cannot read properties of undefined (reading 'shell')"
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
Broken in the same way for me as well, on Linux, with the latest snap version of vs code.
Same for me on native Windows 10 and in WSL2 (Ubuntu 22.04). Is there some workaround available?
Same for me on native macOS (14.2.1 (23C71)) and VS Code 1.85.1 (Universal).
Hi! Are there any updates on this?
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.
Same here. So the extension just breaks the vscode tasks feature and is therefore not usable.
@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.