Global CSS cannot be imported from within node_modules.
See original GitHub issueHi!
Thanks for trying to contibute to solving the Next 10 / Webpack 5 / Ant Design mess 😉
I am trying you solution, but ending up with
info - Creating an optimized production build
Failed to compile.
./node_modules/antd/lib/affix/style/index.less
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/antd/lib/affix/style/index.js
...
Error: > Build failed because of webpack errors
This does not happen if I try to add the <Affix/> component to your example code. I cannot quite figure what the difference is though. Any tips?
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Global CSS cannot be imported from within node_modules.
Main reasons behind this are that we don't compile node_modules further, meaning those files can't be found during pre-rendering and would crash ...
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 >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 >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 ...
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 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
@JesperWe removing
.babelrc
that I had from Next.js example fixed this for me.I created a nextjs package
next-remove-imports
to solve the problem.Example: https://codesandbox.io/s/nextjs-example-react-md-editor-qjhn7?file=/pages/index.js
@JesperWe