Turbopack: :global
CSS selector fails with "Ambiguous CSS module class not supported"
#77522
Labels
CSS
Related to CSS.
Link to the code that reproduces this issue
https://github.com/graulund/next-turbopack-global-css-issue
To Reproduce
npm run dev
)npm run dev-turbo
)styles.module.css
("Ambiguous CSS module class not supported")Current vs. Expected behavior
I would expect the same CSS module code to work regardless of whether Webpack or Turbopack is used. That is, I would expect both
:global(...)
and:global ...
to work. Right now, only the first one works in Turbopack. Both seem to be valid expressions in CSS modules (see https://css-modules.github.io/webpack-demo/, section "Global Selectors").Alternatively, I would expect this relatively cryptic error message to be described in detail somewhere. I found nothing on Google searching for this error message ("Ambiguous CSS module class not supported").
Instead of the same CSS module code working regardless of whether Webpack or Turbopack is used, I get this error on Turbopack:
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020 Available memory (MB): 16384 Available CPU cores: 10 Binaries: Node: 23.7.0 npm: 11.2.0 Yarn: N/A pnpm: 10.6.5 Relevant Packages: next: 15.3.0-canary.23 // Latest available version is detected (15.3.0-canary.23). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
CSS
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
Perhaps vaguely related to #74309, although that PR seems to be addressing a different issue (erroneous filename).
The text was updated successfully, but these errors were encountered: