Node_Modules CSS Import And Next Export
See original GitHub issueBug report
It seems that importing css from node_modules in the _app.js file works fine locally and for normal builds but not for “next export” builds.
Describe the bug
Im using next 9.5.2 and trying to create a static page to put in a subdirectory in a Wordpress website. Everything works fine locally and also when I create the build. The imported css in _app.js for the “react-slick” package is not working though. Can’t find the file. It doesn’t seem like “react-slick”'s problem, since it’s working with SSR and non SSR renders. It’s just the CSS that is not being loaded OR imported right.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- install “react-slick” in an empty next application
- add the global css files in the _app.js
import 'slick-carousel/slick/slick.css';
import 'slick-carousel/slick/slick-theme.css';
- Run locally, everything should be fine.
- Create a build with “next build && next export”
Expected behavior
Project should load all css from node_modules in the _app.js file.
Screenshots
The built code is in this url: https://uniquehairspa.com/cut-and-style/
In Local I don’t have any warnings or errors This is in the released version:
System information
- Next.js: 9.5.2
- Node.js: 12.13.1
Additional context
Package.json file:
{ "name": "nextjs", "version": "4.0.0", "private": true, "dependencies": { "@material-ui/core": "latest", "@material-ui/icons": "^4.9.1", "clsx": "latest", "next": "latest", "prop-types": "latest", "react": "latest", "react-dom": "latest", "react-slick": "^0.27.11", "slick-carousel": "^1.8.1" }, "scripts": { "dev": "next", "build": "next build", "build-static": "next build && next export", "start": "next start", "post-update": "echo \"codesandbox preview only, need an update\" && yarn upgrade --latest" } }
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
You are right, thanks, will do.
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.