AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

Scoped Styled-Jsx Loses Jsx-<Hash> Class On Conditionally Rendered Elements Under TurbopackRustReactCompiler

When experimental.turbopackRustReactCompiler is enabled with reactCompiler:true, conditionally rendered styled-jsx elements in stateful components do not receive the jsx-<hash> scoping class, causing CSS selectors to silently fail.

highConfidence 85%Next.jsAffected V16.3.0

Origin Analysis

The Rust React Compiler port fails to propagate styled-jsx scoping attributes to conditional JSX branches during transformation, unlike the Babel plugin path.
1. Create Next.js 16.3.0 app with reactCompiler:true. 2. In a stateful client component, conditionally render a styled-jsx element inside a <style jsx> block. 3. Run with RUST_COMPILER=1 next dev and inspect SSR output; the jsx-<hash> class is missing.

Fixing Code Block

Edge Case Audit

This hotfix disables the Rust compiler port, potentially reducing build performance or bleeding-edge optimizations. Roll back by setting turbopackRustReactCompiler back to true once upstream fix lands. Test all styled-jsx usages after re-enabling. No changes needed to component code.

Ecosystem Topology