Skip to content
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 Script Explorer tries to execute the labels of a task instead of the script #76711

Closed
daniel-schulz opened this issue Jul 5, 2019 · 8 comments
Assignees

Comments

@daniel-schulz
Copy link

daniel-schulz commented Jul 5, 2019

  • VSCode Version: 1.36.0, 1.36.1
  • OS Version: Windows 10 Pro 1809 (build 17763.437)

Steps to Reproduce:
2019-07-24 13_32_29-Clipboard

  1. Setup any task in the package.json.
  2. Create a task of type NPM with any label different form the script name.
  3. Try to run that task via NPM SCRIPTS
  4. It seems like VSCode is trying to execute the label instead of the script.
    BTW: Executing the task in the command panel works fine:
    2019-07-05 12_51_58-package json - shiftconnector-code4 - Visual Studio Code

I've also recorded the issue see video in the zip file:
video_vscode_npm_scipt_bug.zip

Does this issue occur when all extensions are disabled?: Yes

@vscodebot vscodebot bot added the new release label Jul 5, 2019
@vscodebot
Copy link

vscodebot bot commented Jul 5, 2019

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@daniel-schulz daniel-schulz changed the title Npm Script Explorer tries to execute the labels of a instead of the script Npm Script Explorer tries to execute the labels of task a instead of the script Jul 5, 2019
@daniel-schulz daniel-schulz changed the title Npm Script Explorer tries to execute the labels of task a instead of the script Npm Script Explorer tries to execute the labels of a task instead of the script Jul 5, 2019
@vscodebot vscodebot bot removed the new release label Jul 8, 2019
@daniel-schulz
Copy link
Author

Just installed the new release.
Issue still available in 1.36.1.

@daniel-schulz
Copy link
Author

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

These are no duplicates of this problem.

@daniel-schulz
Copy link
Author

Does no one have the same problem or do I something wrong?
Is it maybe not intended to use task.json together with package.json (npm scripts)?

@egamma
Copy link
Member

egamma commented Jul 29, 2019

@daniel-schulz not clear what your exact scenario is, but if you just want to run a script from the package.json, then you do not need to define tasks. Can you just delete your 'tasks.json' file and try to run the scripts from the NPM Script Explorer directly.

If this doesn't do what you want, then please provide a package.json and tasks.json file so that we can easily reproduce the problem.

@daniel-schulz
Copy link
Author

@egamma Thank you for the reply. I want to use the tasks.json to provide readable labels for my NPM scripts from the package.json.

I've attached a simple workspace with example package.json and tasks.json files.
npm-scripts-issue.zip

@egamma
Copy link
Member

egamma commented Aug 27, 2019

Thanks for the repro, the issue is confirmed.

The code had a check that the script name exists in the package.json, which doesn't work when the task is defined in the tasks.json. I've removed this guard.

@egamma egamma closed this as completed Aug 27, 2019
hunghw pushed a commit to hunghw/vscode that referenced this issue Aug 28, 2019
@daniel-schulz
Copy link
Author

Thank you very much @egamma.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants