You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VS Code tasks fail with error "Cannot read properties of undefined (reading 'shell')" #56
changed the title [-]VS Code tasks (fail with [/-][+]VS Code tasks fail with error "Cannot read properties of undefined (reading 'shell')"[/+]on May 21, 2023
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.
Update for all of you very patient people. I've taken a look at this issue several times over the last couple of years since it was opened and I've had a variety of emotions ranging from confusion to anger as I have tried to work out what the issue was. Today I have finally worked it out - and its just as annoying as you might think.
I was fed up with trying to work out what was logically wrong with the extension and instead decided to brute force the problem by slowly removing parts of the extension until the issue went away. Once I found the section that resolved the issue when removed, I created a brand new extension using the Yo generator tool and tried to reproduce the issue. You can see this reproduction here.
To summarise. VSCode extensions have a dedicated "contributes" section of the package.json which defines a variety of things such as commands, views and configuration. In the Task extension, we define our configuration here under the "task" key (so you end up with setting like "task.path": "/path/to/task"). For whatever reason, using this specific key name completely breaks the built-in VSCode tasks feature. I have absolutely no idea why.
To proceed we can:
Either accept this quirk of VSCode and put all of our configuration under a new key, such as "go-task" or "taskfile" and accept that anyone with existing configuration will need to migrate it.
Raise an issue on the VSCode repository itself to find out if this behavior is intended and what the actual issue is.
If intended, we ask them to provide better documentation to stop this happening again and see point 1.
If not intended, we ask them to fix the issue.
Option 2 may take much longer and not result in a solution. However, it will not break users config and we get to keep our settings namespace. I wanted to gather some thoughts here before raising a ticket on the VSCode project.
@pd93 I suggest openning an issue to see if they respond in reasonable time. If they don't respond in a few days or weeks, we can move the setting namespace.
Another update for those following along. I have fixed this issue by renaming the configuration namespace for Task from task to taskfile. This will be included in the next release and the extension will prompt you to change your settings when it updates (see below). Changing your settings today will have no effect so please wait until you see the prompt.
Please note that the next extension release will require Task to be on v3.45.3+. This version of Task was only released a few days ago and so we will be waiting a little bit longer before releasing the next version of the extension in order to reduce disruption.
I may publish a pre-release version in the coming weeks for those who want to test out the new version and are willing to manually install via a .vsix file.
Since this is a breaking change, the next full release will be v1.0.0.
Activity
[-]VS Code tasks (fail with [/-][+]VS Code tasks fail with error "Cannot read properties of undefined (reading 'shell')"[/+]ilkka commentedon Sep 11, 2023
Broken in the same way for me as well, on Linux, with the latest snap version of vs code.
shalauko commentedon Nov 17, 2023
Same for me on native Windows 10 and in WSL2 (Ubuntu 22.04).
Is there some workaround available?
polamjag commentedon Jan 5, 2024
Same for me on native macOS (14.2.1 (23C71)) and VS Code 1.85.1 (Universal).
siberianbot commentedon May 17, 2024
Hi! Are there any updates on this?
3uclid3 commentedon Jun 9, 2024
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.
MrVermond commentedon Jun 13, 2024
Same here.
So the extension just breaks the vscode tasks feature and is therefore not usable.
ssbarnea commentedon Jun 27, 2024
@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.
pd93 commentedon Sep 11, 2025
Update for all of you very patient people. I've taken a look at this issue several times over the last couple of years since it was opened and I've had a variety of emotions ranging from confusion to anger as I have tried to work out what the issue was. Today I have finally worked it out - and its just as annoying as you might think.
I was fed up with trying to work out what was logically wrong with the extension and instead decided to brute force the problem by slowly removing parts of the extension until the issue went away. Once I found the section that resolved the issue when removed, I created a brand new extension using the Yo generator tool and tried to reproduce the issue. You can see this reproduction here.
To summarise. VSCode extensions have a dedicated
"contributes"section of thepackage.jsonwhich defines a variety of things such as commands, views and configuration. In the Task extension, we define our configuration here under the"task"key (so you end up with setting like"task.path": "/path/to/task"). For whatever reason, using this specific key name completely breaks the built-in VSCode tasks feature. I have absolutely no idea why.To proceed we can:
Option 2 may take much longer and not result in a solution. However, it will not break users config and we get to keep our settings namespace. I wanted to gather some thoughts here before raising a ticket on the VSCode project.
andreynering commentedon Sep 11, 2025
@pd93 I suggest openning an issue to see if they respond in reasonable time. If they don't respond in a few days or weeks, we can move the setting namespace.
pd93 commentedon Sep 11, 2025
microsoft/vscode-discussions#2827
pd93 commentedon Sep 19, 2025
Another update for those following along. I have fixed this issue by renaming the configuration namespace for Task from
tasktotaskfile. This will be included in the next release and the extension will prompt you to change your settings when it updates (see below). Changing your settings today will have no effect so please wait until you see the prompt.Please note that the next extension release will require Task to be on v3.45.3+. This version of Task was only released a few days ago and so we will be waiting a little bit longer before releasing the next version of the extension in order to reduce disruption.
I may publish a pre-release version in the coming weeks for those who want to test out the new version and are willing to manually install via a
.vsixfile.Since this is a breaking change, the next full release will be v1.0.0.
iamkarlson commentedon Jan 5, 2026
Hi @pd93
Have you published it? I just stumbled upon this error too
pd93 commentedon Feb 14, 2026
@iamkarlson v1.0.0 is now released.