-
Notifications
You must be signed in to change notification settings - Fork 26.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NEXT-1296] Multi-file CSS import in layout.js is unpredictable #51213
Comments
We have a smiliar issue. In src/app/layout.tsx we are importing two css files. At first the css from a ui lib out of the node_modules directory and second a global next css file. In dev everything works fine, in production the order of the imports are different and the next css overrides the ui lib css. |
@cptcrank94 does it happen when you import those css files from public/ folder? i did that and it worked for now, but should be fixed in app folder too |
@nabtron we cant import the css from the ui from the public folder because we need to import it via node_modules. |
There's a significant change landed in #51018 which fixes many CSS related problems (I think including this one as well). Could you upgrade to the latest version and verify again? Thanks. |
@shuding no, still having same issue, even with 13.4.7-canary.1 |
The same issue, right now, latest version of today. even I am having this issue now on local env as well. Is there any fix for that? |
Can confirm this is a bug from nextjs |
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:44 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T8103 Binaries: Node: 20.2.0 npm: 9.6.6 Yarn: 1.22.19 pnpm: N/A Relevant packages: next: 13.4.6-canary.0 eslint-config-next: 13.4.5 react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue or a replay of the bug
https://github.com/nabtron/nextjs-css-sequence-bug-01
To Reproduce
Deploy this code on vercel.
Works fine on first deploy.
Then make a small change (add a semicolon or remove it in layout.js on any line).
wait for auto redeploy
The last css file goes missing.
check here: https://nextjs-css-sequence-bug-01.vercel.app/
I saw similar error in another project where the sequence of the css files is auto changed by nextjs too.
Describe the Bug
The css handing of multiple files linked in layout.js (in same directory) is buggy in production mode (works fine in dev mode)
The added repo link is new and clean nextjs project with only multiple css files added.
Sometimes it misses the last file, sometimes it changes their sequence.
Also, how can we ensure the sequence of css files?
Expected Behavior
Files should load in their own sequence.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
on vercel.org
NEXT-1296
The text was updated successfully, but these errors were encountered: