-
Notifications
You must be signed in to change notification settings - Fork 27.6k
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
Turbopack incorrect css modules load order when consuming external components #68412
Comments
@bruno12mota Thank you for submitting an issue! Interesting it's not working with that particular external component. I'll share this with the team! |
@samcx I have exactly the same issue, we are consuming our component library in the consumer project, the component library uses css modules same as the consumer project, but the styles from the external library are at the bottom of the generated css file wish makes them more specific than the local styles from the consumer project. I have started testing since when this is happening, seems the bug was introduced in 14.2.0 it works for me in 14.1.1. I also tested 14.2.5 wish where I originally detected the issue. Generated DEV CSS Files: 14.2.0: |
Still not working on Would be great to know if this is something being worked on right now or if we should find out an alternative solution. |
It's been triaged and it's being worked on. |
Closing since this seems to be fixed, thanks! |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/bruno12mota/next-styles-order
To Reproduce
pnpm i
pnpm dev
Current vs. Expected behavior
CSS modules styles are applying in an incorrect order when consuming external components.
On this particular example, I'm expecting that the
styles.differentBg
is applied with higher priority than the styles applied to LinkButton component on its styles since it's being imported before.Here's the order of applied styles I'm getting:
As you can see
differentBg
is coming before styles imported in the LinkButton component. This seems to happen only for external components since I've also included a LocalButton that is doing the same thing but has the styles applied in the correct order:All of this works correctly if not running with turbo.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.3.0: Wed Dec 20 21:30:44 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T6000 Available memory (MB): 65536 Available CPU cores: 10 Binaries: Node: 18.20.4 npm: 10.7.0 Yarn: N/A pnpm: 7.33.6 Relevant Packages: next: 15.0.0-canary.96 // Latest available version is detected (15.0.0-canary.96). eslint-config-next: N/A react: 19.0.0-rc-3208e73e-20240730 react-dom: 19.0.0-rc-3208e73e-20240730 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Module Resolution, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: