{{ message }}
fix(turbopack): handle valid name-only container queries - #98273
Open
arpankanwer wants to merge 1 commit into
Open
fix(turbopack): handle valid name-only container queries#98273arpankanwer wants to merge 1 commit into
arpankanwer wants to merge 1 commit into
Conversation
Name-only @container (e.g. @container scroll-content) is valid per CSS Containment Module Level 3. With error_recovery enabled, lightningcss emits EndOfInput warning and recovers with None condition, but Next treated it as Error causing Turbopack build failure for valid CSS like nhsuk-frontend. Demote EndOfInput to Warning in turbopack-css severity mapping.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #98261
What
Turbopack build failed with
Parsing CSS source code failed / Unexpected end of inputon valid name-only@containerqueries:This CSS is valid per CSS Containment Module Level 3 (named containers +
scroll-state) and is emitted bynhsuk-frontend@10.6.1.Why
lightningcss(1.33 / 1.0.0-alpha.72) correctly supports name-only containers viaOption<ContainerCondition>. Witherror_recovery:true, it still emits anEndOfInputwarning when parsing@container <name> {(no condition) and recovers withNone.turbopack-css/src/process.rsmappedParserError::EndOfInputtoIssueSeverity::Error, so the warning surfaced as a build error:./src/app/repro.css:2:29 Unexpected end of inputHow
Demote
EndOfInputtoWarningin the severity match (same as other recoverable parser warnings likeUnsupportedPseudo*). The stylesheet already parses andminify/to_csssucceed; only the severity caused the failure.Repro:
cptiv2020/turbopack-parsing-issue-repro—next@canarybefore fix fails at2:29, after fix no longer fails.cargo check -p turbopack-csspasses. Directlightningcsstest witherror_recovery:trueshows 1 warningEndOfInputat1:29now treated asWarning.Test
cargo check -p turbopack-css— passnpm run buildon repro withnext@canarybefore: Turbopack error2:29; after fix: expected to pass (warning only)lightningcssdirect parse witherror_recovery:true→EndOfInputwarning nowWarning