Global CSS cannot be imported from within node_modules.
See original GitHub issueI got this error after installing this package:
Failed to compile
./node_modules/tippy.js/animations/scale.css
Global CSS cannot be imported from within node_modules.
Read more: https://err.sh/next.js/css-npm
Location: node_modules/react-wordcloud/dist/index.module.js #
Not quite sure how to fix it. Can you please help taking a look?
Thank you for the work!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Global CSS cannot be imported from within node_modules.
I can't import a css file from a node_modules 3rd party library as described here (https://nextjs.org/docs/basic-features/built-in-css-support# ...
Read more >Next.js Global CSS cannot be imported from files other than ...
Hey, I created and move the main. · @IndustryDesigns, try to use node-sass instead of @zeit/next-sass , I just tested it and updated...
Read more >Global CSS cannot be imported from within node_modules
18 Day 11 77. Combinations Given two integers n and k, return all possible combinations of k numbers out of the range [1,...
Read more >Next.js: Global CSS cannot be imported from files other than ...
When migrating to Next.js 9+, I was running into an issue where I could not import global styles from any file other than...
Read more >Next.js Global CSS cannot be imported from files other than ...
CSS : Next.js Global CSS cannot be imported from files other than your Custom App [ Beautify Your Computer ...
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
Hey guys, this issue seems specific to
next
. Although, ideally I should decouple the CSS from the JS package and have users explicitly import the CSS file. However, since the version has been shipped with included CSS in the past, I want to avoid introducing breaking changes just because of this.I’ve never used
next
but after 30min of digging, I found out how to fix this thanks to your repro @xiqi. Here’s the fix:The
next.config.js
that fixes it is:It seems that the person who filed the issue has asked for more formal support of CSS by default in an RFC, but hopefully this is a short-term fix for
next
-related builds. Let me know if the issue persists and reopen the issue.Actually, I take that back, it’s broken for me @chrisrzhou… Works when I run
NODE_ENV=development next dev -p 8025
but breaks when I runnext build
, same as what @suino reported above ☝️