-
Notifications
You must be signed in to change notification settings - Fork 27k
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
CSS Module chunking isn't working as intended - duplicates. #11448
Comments
I am having the same issue with my project. Each page chunk has duplicates of the same css module css. Then as you navigate between routes, it loads the same class multiple times, which creates specificity problems. |
I just wanted to add a little more info that may be helpful. Note: to help with debugging I limited the number of chunks to 1. When I include the same components in the different pages, no chunk is created.
When I
I would not expect this to happen as _app is core to the application and should be in the main css bundle. This breaks stuff because:
class a gets applied again and some parameters get overridden again making the component display incorrectly. Should _app.js styles always be declared first in the dom? I have this problem in all pages and I'm juggling components between _app.js and the pages in order to have components display correctly. |
Notthing here, in my project the problem still persist. Someone fixed the problem in your personal project? |
This has been resolved on |
@Timer thanks for the heads up. Is there any more details in what was fixed to resolve this? In our particular case (we're using next-css and next-sass, not the built-in css build) we're still experiencing the same bug. Perhaps with more details we can figure out some similarities with our scenario. Maybe something exclusively altered in the built-in css build config that needs to be "replicated" in the next-css usage? I'll try to create a reproduction repo if there's intention in trying to resolve this in those particular settings (using these plugins and not the built-in). Just to clarify in a short way, in our scenario it would be a massive change in many projects to adapt to the built-in css characteristics (css modules coming from node_modules, shared global css and all) |
This fix requires the built-in CSS support and isn't translatable to |
@Timer sorry, I don't understand, what we should do then? I use |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Love the library, love zeit just though i'd use your website as an example.
Chunks contain duplicate class names resulting in weird/unexpected ordering of css. The example provided here doesn't show the ordering breaking however in my own application classes specificity can change depending on the order of classes duplicated.
Describe the bug
Chunks contain duplicate classes across multiple chunks.
To Reproduce
I don't have a reproduction repository as i don't have time but looking at zeit.co i can tell its using Next 9.3+ so therefore the reproduction is simple look at your own website and inspect this element "tooltip container"
Steps to reproduce the behavior, please provide code snippets or a repository:
2: inspect recent activity text
3: find span with class "tooltip_container"
look at how many duplicate class names are applied.
Expected behavior
css classes are not duplicated across chunks
The text was updated successfully, but these errors were encountered: