NPM tasks with a path have an extra character in the path #146165
Labels
bug
Issue identified by VS Code Team member as probable bug
insiders-released
Patch has been released in VS Code Insiders
tasks
Task system issues
verified
Verification succeeded
Milestone
Does this issue occur when all extensions are disabled?: Yes/No
Steps to Reproduce:
extension
subdirectory.
and./extension/
cd extension && npm ci
Why?
9.
extension/tasks.json
customizesnpm watch
to be a background task:"isBackground": true,
.launch.json
has"preLaunchTask": "npm: watch"
, but it ignores tasks.json and just runsnpm watch
without customization.10. Next we show that
launch.json
actually knows abouttasks.json
, but ignores it. Add label to the task:"label": "SomeTaskLabel",
and specify that label inlaunch.json
:"preLaunchTask": "SomeTaskLabel"
.11. Stop all tasks and press F5 again
12. The debugging session launches correctly
This demonstrates that
launch.json
can correctly reference task configuration fromtasks.json
, but decides to ignore it.P.S. I spent several hours pulling out my hair and I wish VSCode was less ambiguous and did not silently ignore configurations. It should be clear whether the
preLaunchTask
references a task or an npm script.P.P.S. This area has more questionable design:
If the task has
"path": "123"
(but no label), then the following launch setting surprisingly makes things work:"preLaunchTask": "npm: watch - 12"
. Note that the last character3
needs to be cut off. This is really a WTF-type behavior. And when using"path": "."
you need"preLaunchTask": "npm: watch - "
(note the trailing space).This
"preLaunchTask": "npm: watch - <task path with last character cut off>"
format is confusing not described anywhere. I prefer proper structure instead of a string with unknown format.The text was updated successfully, but these errors were encountered: