Open tinleym opened 1 year ago
Hi there, I created an issue that may also be related: https://github.com/vercel/next.js/issues/59308
I have this issue using Edge runtime with parallel routes. Server or client component doesn't seem to make any difference in this case.
Next.js 14.0.5-canary.5
I have the same issue. In a page i'm importing a css module that uses a base style. In the parallel route i'm importing the same style to make use of composes attribute. This import inside route parallel is overwriting the page styles.
Link to the code that reproduces this issue
https://github.com/tinleym/next-no-parallel-shared-server-layout-css
To Reproduce
Current vs. Expected behavior
This reproduction demonstrates that CSS Modules are not loaded for a server component shared between two conditional parallel routes.
On opening the page, you'll see no background colors for the components under Server Layout and Server Page because their styles did not load. These are server components shared between conditional route groups @guest and @registered.
Their styles will load if
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
These CSS Modules / Parallel Routes issues may or may not be related:
https://github.com/vercel/next.js/issues/53292 -- maybe an inactive conditional route doesn't fully load all its resources when it runs, so a shared CSS Module becomes an empty reference?
https://github.com/vercel/next.js/issues/52245 -- another instance where CSS Modules don't work with parallel routes