Repository navigation
fix(vite,nitro): link null-byte virtual css through /@id/ in dev - #36549
Conversation
@nuxt/kit
@nuxt/nitro-server
nuxt
@nuxt/rspack-builder
@nuxt/schema
@nuxt/vite-builder
@nuxt/vite-server
@nuxt/webpack-builder
commit: |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughCSS collection in Nitro SSR and Vite now converts module IDs to Vite development URLs. Tests cover path-based, wrapped, virtual, and NUL-prefixed IDs. A development fixture registers a NUL-prefixed virtual stylesheet, and an integration test checks its rendered URL and CSS response. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change appears ready to merge after normal checks; no actionable merge-blocking risk was identified. Pre-merge checks |
|

🔗 Linked issue
📚 Description
with
@unocss/nuxtin dev, the SSR HTML contains a stylesheet link with a literal NUL byte in it:the HTML tokenizer replaces the NUL with U+FFFD, so the browser requests
/_nuxt/%EF%BF%BD/__uno.css- and uno happens to resolve that by suffix, but it means there are two copies of its stylesheet injected.this PR maps non-path ids to
/@id/(with\0as__x00__) before they become links, the same way Vite itself does. this also applies to bare virtual ids likevirtual:foo.css, which only happened to work before....