question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent CSS between dev and build

See original GitHub issue

Bug 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): image

Build: (Duplicated styles, inconsistent result:) image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
timneutkenscommented, Aug 31, 2020

Can you try next@canary? Many issues with CSS / ordering of CSS were solved recently.

2reactions
timneutkenscommented, Jul 8, 2021

Please open a new issue with a full reproduction.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found