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

Support Bazel workspace (or any non-npm workspace) #2346

Open
xgwang-scienceos opened this issue Apr 23, 2024 · 0 comments
Open

Support Bazel workspace (or any non-npm workspace) #2346

xgwang-scienceos opened this issue Apr 23, 2024 · 0 comments
Labels
feature request New feature or request

Comments

@xgwang-scienceos
Copy link

Description

In vscode, when working on a package under a Bazel workspace, the bazel build command will generate the node_modules directory in separate directory, instead of directly under the package itself. This causes the svelte language server not able to properly lint modules.

Here is an example error:

Error in svelte.config.js

Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@sveltejs/adapter-auto' imported from /Users/<user>/<bazel-workspace-root>/<bazel-svelte-package>/svelte.config.js

Here is an example file directory:

- <bazel-workspace-root>/
   - WORKSPACE
   - <bazel-svelte-package>/
     - src/
     - static/
     - BUILD
     - package.json 
     - svelte.config.js

I wonder if we can consider adding language server support for Bazel workspace, or any non-npm workspace where the node_modules directory is not located directly under the package itself?

Proposed solution

After creating a Svelte project in a Bazel workspace, the Svelte language server will work after running Bazel build on the Svelte Bazel target. At this point, a node_modules directory is created by Bazel, e.g. $(bazel info bazel-bin)/node_modes. The Svelte language server should be able to properly lint node modules in the Bazel created node_modules directory.

Alternatives

No response

Additional Information, eg. Screenshots

Screenshot 2024-04-23 at 1 20 28 PM
@dummdidumm dummdidumm added the feature request New feature or request label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants