Closed mvgrimes closed 1 month ago
Seems like the current behavior is due to the lightningcss library which is used by nextjs for parsing css while turbo is enabled. I have found the relevant issue on the lightingcss repo: https://github.com/parcel-bundler/lightningcss/issues/661 Hope this helps
Indeed this is a bug in lightningcss 👍
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/mvgrimes/turbo-14.2-css-issue
To Reproduce
pnpm i ; pnpm run dev
gloabal.css
:Current vs. Expected behavior
When running
next dev --turbo
in version 14.2.0-canary.14 or later, CSS using the:is
pseudo-class is compiled incorrectly.The following CSS in the
src/app/global.css
file:Generates
.next/static/chunks/src_app_globals_b52d8e.css
:Under version
14.2.0-canary-13
, it generates.next/static/chunks/src_app_globals_b52d8e.css
:It looks like it might be trying to simplify the
.cb:is(...)
. Possibly trying to produceinput.cb:checked
.The CSS compiles correctly without the
--turbo
flag or in production (ienext build
).Provide environment information
Which area(s) are affected? (Select all that apply)
Developer Experience, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
The issue was first observed in 14.2.0-canary.14. The issue also appears in 14.2.0, 14.2.1, 14.2.3, 14.3.0-canary.80, and 15.0.0-rc.0.
The issue is not observed in 14.2.0-canary.13. It is observed when running any version without the
--turbo
flag. It is also not observed when creating a production build.