CSS Modules cannot be imported from within node_modules when not using a node_modules export
See original GitHub issueWhat version of Next.js are you using?
11.1.2
What version of Node.js are you using?
16.6.0
What browser are you using?
Firefox
What operating system are you using?
Windws
How are you deploying your application?
next start
Describe the Bug
error - ./styles/Album.module.scss CSS Modules cannot be imported from within node_modules.
This error appears without explicitely importing from node_modules. Only imports used are `@import ‘bootstrap/scss/_functions.scss’; @import ‘bootstrap/scss/_variables.scss’; @import ‘bootstrap/scss/_mixins.scss’;
@import “./Variables.scss”;`
Expected Behavior
No error
To Reproduce
No clear steps to reproduce
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:5 (2 by maintainers)
Top Results From Across the Web
[9.3] CSS Modules cannot be imported from within ... - GitHub
I'm trying to properly migrate to Next 9.3 and use the built-in sass feature. When I have a file named *.module.scss (not even...
Read more >CSS Modules cannot be imported from within node_modules
There's a workaround. You can use next-css. It seems to be a duplicate of https://stackoverflow.com/a/55255918/19135131. Does it help you?
Read more >Features | Vite
In this case, the processed CSS string is returned as the module's default export as usual, but the styles aren't injected to the...
Read more >css modules cannot be imported from within node_modules
When I have a file named *.module.scss (not even imported), I have warnings in the terminal saying that CSS Modules cannot be imported...
Read more >Basic Features: Built-in CSS Support - Next.js
Next.js supports including CSS files as Global CSS or CSS Modules, using ... importing a CSS file from node_modules is permitted anywhere in...
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 Free
Top 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
https://github.com/jorgev259/bug-test Repo where i managed to replicate the bug
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.