Turbopack: CSS prioritization differs between next dev --turbopack and next build --turbopack #83604
GlebKodrik
started this conversation in
Turbopack Error Report
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Link to the code that reproduces this issue
https://github.com/GlebKodrik/turbopack-style/
To Reproduce
Run the app in development with next dev --turbopack
→ Styles load correctly, no issues observed.
Build the app with next build --turbopack and then start with next start
→ Styles are applied in a different priority/order compared to dev mode.
Notes:
The issue reproduces 100% on our current setup.
Sometimes deleting the pages folder or a random component in entities makes the bug disappear, which makes the behavior unpredictable.
Current vs. Expected behavior
Current: In production (next build --turbopack + next start), CSS order/priority differs from development, breaking the layout.
Expected: Style prioritization should be consistent between dev and build modes when using Turbopack.
Provide environment information
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Happens locally with next build --turbopack → next start.
Cannot reproduce when running next dev --turbopack.
Issue sometimes disappears after removing a random folder/component, which suggests non-deterministic style bundling.
1 image - next dev --turbopack
2 image next build --turbopack → next start
Use route my project: http://localhost:3000/intensive/31BoMCUUsroffEMtAmd6ALUmZ0y
Beta Was this translation helpful? Give feedback.
All reactions