cloudflare/vinext

Pages Router streaming SSR: `styled-jsx` rules not emitted in canonical Next.js format

Open

#1,556 建立於 2026年5月22日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)TypeScript (329 fork)github user discovery
adapter-api-e2ehelp wanted

倉庫指標

Star
 (8,120 star)
PR 合併指標
 (平均合併 1天 1小時) (30 天內合併 462 個 PR)

描述

This issue was created by an agent analysing CI failures from the Next.js Deploy Suite (vinext main vs Next.js v16.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

  1. Reproduce first in vinext's own test suite. Add a Pages Router streaming-SSR page using styled-jsx and assert the emitted <style> block matches the canonical minified shape Next.js produces.

  2. 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.

貢獻者指南