-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NPM tasks with a path have an extra character in the path #146165
Comments
@Ark-kun Does this match your workspace setup? When I F5'd the prelaunch task ran correctly as a background task. |
@alexr00 Thank you for trying to reproduce the issue. Your workspace setup seems to be identical to what I had. Prior to reporting this issue I've isolated and created a PoC repo identical to the one that you have to validate the bug and experiment with solutions. My setup was triggering the issue reliable despite restarting VSCode, so I assumed that the repro rate was 100%. Unfortunately, it did not occur to me to record a video. My second issue (wrong auto-generated task label) is still there, but I should probably create a separate issue for that: Thank you again. |
I can repro, and that's definitely a bug. Let's repurpose this issue for the the path bug. |
Repro:
|
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: