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

'vscode' in 'dependencies' instead of 'devDependencies' #1414

Closed
anthonyjclark opened this issue Mar 13, 2024 · 2 comments
Closed

'vscode' in 'dependencies' instead of 'devDependencies' #1414

anthonyjclark opened this issue Mar 13, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@anthonyjclark
Copy link

When following the Building an Extension tutorial, I ran into the following error message:

❯ vsce package
(node:55696) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ERROR  You should not depend on 'vscode' in your 'dependencies'. Did you mean to add it to 'devDependencies'?

Langium version: [email protected]

Steps To Reproduce

  1. Follow the tutorials starting from the beginning
  2. Encounter error on step running the vsce package command

The current behavior

The error described above.

The expected behavior

Building an extension for VS Code.

Possible Solution

I was able to fix the issue by moving this line:

    "dependencies": {
        ...
        "vscode": "npm:@codingame/[email protected]"
        ...
    }

To devDependencies.

The error seems to have been introduced by #1205.

@anthonyjclark anthonyjclark added the bug Something isn't working label Mar 13, 2024
@msujew
Copy link
Member

msujew commented Mar 14, 2024

That's not an error (at least not one on our side). The vscode dependency used in there is a very special runtime dependency that implements the whole vscode API on top of monaco. It is not intended to be used in vscode extensions.

In order to build a vscode extension, you will need to split the generated project into multiple npm workspaces. It might make sense to add this to the yeoman generator by default, but the behavior exhibited here is correct. One could argue that vsce is at fault here, since it shows a false positive.

@anthonyjclark
Copy link
Author

Thank you for the input. I am not sure I understand your comment about splitting into different npm workspaces, but I will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants