Inconsistent CSS between dev and build
See original GitHub issueBug report
Describe the bug
When using the “Built-in CSS support”, the ordering of the CSS classes (and number of times a class is declared) is not consistent between development and production.
Because of this, you can see some CSS styling “pop” around when navigating between pages.
I believe the order is correct in SSR, but not in the client-side loaded bundles (as more CSS is loaded asynchronously, the ordering is lost and duplicated styles are loaded)
To Reproduce
Just run next build
, the issue seems to be out-of-the-box with CSS modules?
Expected behavior
The resulting CSS styles ordering should be identical between dev and prod.
Screenshots
Dev: (Desired behaviour):
Build: (Duplicated styles, inconsistent result:)
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Inconsistent CSS Styling Differs Between gatsby develop and ...
CSS is aligning well in development but in the build the css is inconsistent. It is different. I tried importing my css files...
Read more >CSS inconsistency after build : r/nextjs - Reddit
Hi, I'm pretty new to next.js and I'm having issues with the css after building my app. Im dev environment everything works fine...
Read more >Handling common HTML and CSS problems - MDN Web Docs
This includes linting code, handling CSS prefixes, using browser dev tools to track down problems, using polyfills to add support into browsers, ...
Read more >Solution To The Browser Inconsistency Problem | by Sonika
The problem with CSS Resets is that they are ugly: they have a big chain of selectors, and they make a lot of...
Read more >Troubleshoot pipeline runs - Azure DevOps - Microsoft Learn
After that, each of your build pipelines will run one more time. ... Can't access Azure Key Vault behind firewall from Azure DevOps....
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
Can you try next@canary? Many issues with CSS / ordering of CSS were solved recently.
Please open a new issue with a full reproduction.