Skip to content
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

Inconsistent CSS between dev and build #16723

Closed
loteoo opened this issue Aug 31, 2020 · 11 comments
Closed

Inconsistent CSS between dev and build #16723

loteoo opened this issue Aug 31, 2020 · 11 comments
Milestone

Comments

@loteoo
Copy link

loteoo commented Aug 31, 2020

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

@loteoo loteoo changed the title Inconsistent CSS / duplicated styles between dev and build Inconsistent CSS between dev and build Aug 31, 2020
@timneutkens
Copy link
Member

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

@phildeschaine0
Copy link

Can confirm, having an issue with styles not appearing in next start where they did appear on next dev. Issue happens in 9.5.3 and in 9.5.4-canary.3 but not in 9.5.0.

@Timer
Copy link
Member

Timer commented Sep 8, 2020

OP responded with 👍 to the comment above so closing as fixed. If anyone has new reproductions, please file a new issue. Check #16630 as a duplicate first!

@Timer Timer closed this as completed Sep 8, 2020
@Timer Timer added this to the iteration 9 milestone Sep 8, 2020
@Blagoj5
Copy link

Blagoj5 commented Sep 22, 2020

I'm having same issue with sass. I found one workaround here: https://medium.com/iryl/control-css-imports-order-for-next-js-webpack-based-production-applications-3b69765444fd. You import all .scss parts of your app into one main app by the order you want and everything should work fine. However my app is pretty big so i don't play to do that. I can confirm on 9.5.4-carnary.3 is not WOKRING properly

@uixcrazy
Copy link

I've used next v.10.0.6, and having the same. I can't find any solutions for this.

10148

@le-martre
Copy link

Same here, same issue with Next V.10.0.7, sass: ^1.32.8

@yenicelik
Copy link

Using Next V 11.0.0 and having the same issue

@oaa97181
Copy link

Saaaame
"next": "^11.0.1",
"react": "^17.0.2",

Only hotfix i found out is to throw an !important on every css module class that's broken.

@le-martre
Copy link

@Timer Can we re-open or should we re-create a new issue ?

@timneutkens
Copy link
Member

Please open a new issue with a full reproduction.

@dotsinspace

This comment has been minimized.

@vercel vercel locked as off-topic and limited conversation to collaborators Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants