question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find any of modules: sass,node-sass

See original GitHub issue

Describe 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

Snipaste_2021-12-03_14-23-39

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:open
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
dummdidummcommented, Dec 16, 2021

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?

  • Option 1: ignore errors that come from missing modules if there’s no svelte.config.js
  • Option 2: same as option 1 but print a warning with more explanation instead. For svelte-check, this could be a one-time when it’s first encountered to not clutter up diagnostics.

What do others think about this?

1reaction
jasonlyu123commented, Mar 9, 2022

@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 into rollup-plugin-svelte in your rollup config.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found