Pages Router streaming SSR: `styled-jsx` rules not emitted in canonical Next.js format
#1,556 opened on 2026年5月22日
Repository metrics
- Stars
- (8,120 stars)
- PR merge metrics
- (平均マージ 1d 1h) (30d で 462 merged PRs)
説明
This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext
mainvs Next.jsv16.2.6, 2026-05-22).
Problem
With custom Next config enabling streaming, a page using styled-jsx should produce inline minified CSS like <style>p{color:blue}</style> in the SSR output. vinext does emit literal CSS inside <style>, but the rule is multi-line / unminified so the canonical match pattern /color:(?:blue|#00f)/ fails. The styled-jsx transform is not producing the expected minified output format.
Expected pattern: /color:(?:blue|#00f)/
Received: ...<style>\n p {\n color: blue;\n }\n</style>...
Estimated Impact
~1 test failures across the deploy suite.
Affected Test Suites
test/e2e/streaming-ssr/index.test.ts
Recommendation
-
Reproduce first in vinext's own test suite. Add a Pages Router streaming-SSR page using
styled-jsxand assert the emitted<style>block matches the canonical minified shape Next.js produces. -
Run the styled-jsx transform. The styled-jsx Babel/SWC plugin should produce minified CSS. Ensure that runs for streaming-SSR builds too.
Part of #1328.