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
styles flickering in dev with tailwind + css modules #12448
Comments
I suspect this may have something to do with the automatic code splitting of css modules 🤔 |
Probably related to #10268 |
I have used plain css modules for components and styles apply after some ms. |
According to https://stackoverflow.com/a/42969608/943337 i just added an empty script tag and my problem of a sidebar which was popping up at first load, is now solved. vercel/next-plugins#455 (comment)
|
Thanks @Adrianjs42 the side bar popping in stopped in chrome. |
Also related |
There is a workaround to resolve this problem
Add add this styles in the global styles:
|
We previously used to remove our FOUC helper inside of the style injection to ensure content was shown as fast as possible. This behavior, however, was problematic for a few reasons: 1. Large JavaScript chunks would take longer than an animation frame to parse, causing FOUC 1. Rendering would sometimes complete before an animation frame, causing improper effects To fix the latter, we started removing the no FOUC helper **before** rendering, however, we never fixed the former by removing the dead code. There's not a great way to test this because the FOUC is so fast and flaky, however, this code really shouldn't exist and isn't likely to be re-added (regress). Also, we already have FOUC tests that occasionally flake, probably due to this. Fixes #12448 Fixes #13058 Fixes #11195 Fixes #10404
This should be fixed in |
@Timer , I have installed Note that I'm using material-ui + css modules Heres a version of the app that I've been working on facing this issue: https://cluster-11-lwj6nmcgy.vercel.app/ . |
@Prottoy2938 Same here. I made a comment to this issue #13058 (comment) |
Seems this your case is unrelated to css modules / tailwind and more so related to forgetting to implement pre-rendering of material-ui: #7322 (comment) |
@casperle , In my case the problem was because I was doing server side rendering. I followed this documentation from material-ui and fixed the issue |
With v9.4.5-canary.28 not flickering in dev and flickering in production. |
We previously used to remove our FOUC helper inside of the style injection to ensure content was shown as fast as possible. This behavior, however, was problematic for a few reasons: 1. Large JavaScript chunks would take longer than an animation frame to parse, causing FOUC 1. Rendering would sometimes complete before an animation frame, causing improper effects To fix the latter, we started removing the no FOUC helper **before** rendering, however, we never fixed the former by removing the dead code. There's not a great way to test this because the FOUC is so fast and flaky, however, this code really shouldn't exist and isn't likely to be re-added (regress). Also, we already have FOUC tests that occasionally flake, probably due to this. Fixes vercel#12448 Fixes vercel#13058 Fixes vercel#11195 Fixes vercel#10404
Bug report
Describe the bug
I'm using tailwindcss with css modules and I notice that the first time the page loads, all my styles are not loaded. Trying to figure it put what was happening, I run the tailwindcss example and added a style from a css module and it happens there too, even when built for prod.
To Reproduce
Run the example from https://github.com/zeit/next.js/tree/canary/examples/with-tailwindcss
Add a
index.module.css
file with some styleadd the styles form the css module in the
index.js
pageExpected behavior
Without the use of the css modules, all styles are loaded fine the first time, without flickering. Same behavior is expected using css modules
Screenshots
System information
The text was updated successfully, but these errors were encountered: