Back to all fixes
CuratedTypeScriptVite 8local
Vite 8.0.0 SSR crash on inline style @import: 'specifiers must be a non-empty string'
Problem
Server-side rendering with Vite 8.0.0 throws `TypeError: The specifiers must be a non-empty string. Received "?html-proxy&direct&index=0.css"` when an HTML page has an inline `<style>` block containing an `@import` statement (e.g. a Google Fonts import in a raw `<style>` tag). Regression from Vite 7.
Solution
typescript
Actual bug fix merged in vite#21837: the CSS proxy URL construction used the internal proxyModulePath (still containing the virtual `\0` marker) instead of the properly formatted proxyModuleUrl - upgrade to the Vite version containing that PR. App-level workaround needing no code changes: replace the inline `<style>@import url(...)</style>` with a standard `<link rel="stylesheet" href="...">` tag (the recommended way to load Google Fonts anyway), which avoids the proxy path entirely.