CSS Styles from unrelated layouts are merged if they have one CSS file in common #64773
Labels
bug
Issue was opened via the bug report template.
linear: next
Confirmed issue that is tracked by the Next.js team.
Link to the code that reproduces this issue
https://github.com/onigoetz/nextjs-css-issue-repro
To Reproduce
Current vs. Expected behavior
The background should be green but is red.
The styles from the subpage http://localhost:3000/leakingstyle are applied to http://localhost:3000/ but they have no layout in common and should not. It seems that because they have another CSS file in common they are merged
Another page next to it that has no css file in common does not have this issue : http://localhost:3000/otherstyle
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Jun 2 00:45:15 UTC 2023 Available memory (MB): 17991 Available CPU cores: 6 Binaries: Node: 20.11.1 npm: 10.2.4 Yarn: 1.22.21 pnpm: 8.14.1 Relevant Packages: next: 14.2.2 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: N/A Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local), Vercel (Deployed)
Additional context
I tested multiple versions:
Apparently the issue has been introduced in https://github.com/vercel/next.js/releases/tag/v14.2.0-canary.28
I would bet that the issue was introduced in this PR : #63157
The text was updated successfully, but these errors were encountered: