nextjs - 💡(How to fix) Fix LightningCSS: Using `@container scroll-state` blows build [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#88768Fetched 2026-04-08 02:04:00
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×2closed ×1commented ×1issue_type_added ×1

Code Example

This happens regardless of environment.
RAW_BUFFERClick to expand / collapse

Link to the code that reproduces this issue

https://lightningcss.dev/playground/index.html#%7B%22minify%22%3Atrue%2C%22customMedia%22%3Atrue%2C%22cssModules%22%3Afalse%2C%22analyzeDependencies%22%3Afalse%2C%22targets%22%3A%7B%22chrome%22%3A6225920%7D%2C%22include%22%3A0%2C%22exclude%22%3A0%2C%22source%22%3A%22%40container%20scroll-state(scrollable%3A%20x)%20%7B%5Cn%20%20.cls%20%7B%5Cn%20%20%20%20display%3A%20block%3B%5Cn%20%20%7D%20%20%5Cn%7D%22%2C%22visitorEnabled%22%3Afalse%2C%22visitor%22%3A%22%7B%5Cn%20%20Color(color)%20%7B%5Cn%20%20%20%20if%20(color.type%20%3D%3D%3D%20'rgb')%20%7B%5Cn%20%20%20%20%20%20color.g%20%3D%200%3B%5Cn%20%20%20%20%20%20return%20color%3B%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%22%2C%22unusedSymbols%22%3A%5B%5D%2C%22version%22%3A%221.30.2%22%7D

To Reproduce

  1. Start a new Next build with Turbopack
  2. Use the CSS @container scroll-state(scrollable: x) { ...insert rules here ...} in a CSS file

Current vs. Expected behavior

The CSS Build explodes. Turbopack doesn't have the ability to disable Lightning CSS so you just can't use the above.

Provide environment information

This happens regardless of environment.

Which area(s) are affected? (Select all that apply)

Turbopack

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)

Additional context

Issue with Lightning CSS and the inability to disable it in favor of PostCSS with Turbopack.

extent analysis

TL;DR

Disable Lightning CSS in favor of PostCSS when using Turbopack by exploring configuration options that allow fallback to PostCSS for CSS processing.

Guidance

  • Investigate Turbopack configuration to see if there's an option to disable Lightning CSS or fall back to PostCSS for specific CSS files or rules.
  • Check the documentation of Next.js and Turbopack for any mentions of compatibility issues with Lightning CSS and potential workarounds.
  • Consider reaching out to the Turbopack or Next.js community for advice on how to handle CSS processing with Lightning CSS disabled.
  • Look into the next.config.js file for any customization options that might allow disabling Lightning CSS for specific builds or environments.

Example

No specific code example is provided due to the lack of detailed configuration files in the issue description. However, the solution likely involves modifying the next.config.js file to adjust CSS processing settings.

Notes

The issue seems to stem from the inability to disable Lightning CSS when using Turbopack with Next.js, which suggests a potential configuration or compatibility issue rather than a code-level problem. The solution will likely involve adjusting project settings or configurations rather than modifying the CSS code itself.

Recommendation

Apply a workaround by configuring Turbopack to use PostCSS for CSS processing, as directly upgrading or changing versions may not be feasible without further information on the project's constraints.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix LightningCSS: Using `@container scroll-state` blows build [1 comments, 2 participants]