Cannot find any of modules: sass,node-sass
See original GitHub issueDescribe the bug
The same as #622, but I can not get over it.
To Reproduce
I didn’t use svelte-preprocess
and/or svelte.config.js
. I’m using the @sveltejs/vite-plugin-svelte and let vite handle the preprocessing through useVitePreprocess option.
In fact, this plugin works well and vite does not complain about it. But vscode does not think so, it throws error on <style lang="scss">
tag about not founding “sass” or “node-sass” package.
I’ve created a reproduction repo: https://github.com/hyrious/vite-svelte-sass-bug.
I have tried these steps but no luck:
- add
svelte.language-server.runtime
option - install
sass
both in the project and in global
Expected behavior
The extension should be able to find the sass module.
Screenshots
System (please complete the following information):
- OS: macOS 12.0.1
- IDE: VSCode
- Plugin/Package: Svelte for VSCode, svelte-language-server
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
"Cannot find any of modules: sass,node-sass ... - GitHub
Steps to reproduce the behavior: Install svelte-preprocess and sass; Configure svelte.config.js by setting the sass.implementation to `require(' ...
Read more >ERROR in Cannot find module 'node-sass' - Stack Overflow
Whenever you did npm install to the initial installation, the sass module did not get installed, which is why this problem occurs. Share....
Read more >Cannot find module 'node-sass' error | bobbyhadz
To solve the error "Cannot find module 'node-sass'", make sure to install the node-sass package by opening your terminal in your project's root...
Read more >Cannot find module 'node-sass' on NPM build
I tried running a build 'ng build --prod' locally and didnt encounter any errors. I also tried add a new build step calling....
Read more >Cannot Find Module Sass: 8 Solutions That You Can Use in ...
Cannot find module sass is an error that occurs when your project does not have the Sass library as a dependency. Irrespective of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m very hesitant to add any other dependencies solely for preprocessor diagnostics. Right now Less and SASS seem like a good addition, but with the rise of TailwindCSS people might expect something there, too, and over time it could become too bloated, and removing already added stuff is then somewhat of a breaking change. Therefore I’d like to keep this to TypeScript-only for now. Maybe we should instead switch how we deal with these diagnostic errors?
svelte.config.js
svelte-check
, this could be a one-time when it’s first encountered to not clutter up diagnostics.What do others think about this?
@Lucide That’s unrelated to this issue. In your case, You need a
svelte.config.js
as the language server also need to know how to preprocess. And we can’t read the config passed intorollup-plugin-svelte
in your rollup config.