With @vitejs/plugin-rsc@0.5.34, vite@8.3.0, and vinext@1.0.0-beta.9, an RSC production asset manifest can retain a shared CSS-only JavaScript chunk that Vite removes before writing client output. SSR then emits a module preload to a nonexistent file (404).
Minimal arrangement using the Vinext App Router:
app/page.tsx -> app/client.tsx ("use client") -> import "./shared.css"
app/second/page.tsx -> app/other-client.tsx ("use client") -> import "./shared.css"
Both pages render their corresponding client component. shared.css contains a simple nonempty selector. Build with a second-origin assetPrefix, start the production app, and inspect dist/server/__vite_rsc_assets_manifest.js and dist/client. Our isolated fixture generates a shared-*.js dependency in the manifest but no corresponding client file. The browser requests that missing module. The reproduction has no authentication or recovery service worker.
In the installed plugin bundle, rsc:virtual:vite-rsc/assets-manifest collects client dependencies in a normal generateBundle hook. Vite's CSS postprocessing subsequently removes pure CSS chunks and updates imports. Running this asset-manifest hook with order: "post" resolves the reproduced missing-module requests while retaining the shared CSS dependency. Both client navigation and a warm-cache reload pass in the fixture after that change.
Is moving this hook after CSS postprocessing the appropriate upstream fix, or is another supported configuration intended? This is separate from stylesheet crossorigin issue #1464. We currently keep a source/version-checked local patch and will remove it after a released upstream correction passes the reproduction.
With
@vitejs/plugin-rsc@0.5.34,vite@8.3.0, andvinext@1.0.0-beta.9, an RSC production asset manifest can retain a shared CSS-only JavaScript chunk that Vite removes before writing client output. SSR then emits a module preload to a nonexistent file (404).Minimal arrangement using the Vinext App Router:
Both pages render their corresponding client component.
shared.csscontains a simple nonempty selector. Build with a second-originassetPrefix, start the production app, and inspectdist/server/__vite_rsc_assets_manifest.jsanddist/client. Our isolated fixture generates ashared-*.jsdependency in the manifest but no corresponding client file. The browser requests that missing module. The reproduction has no authentication or recovery service worker.In the installed plugin bundle,
rsc:virtual:vite-rsc/assets-manifestcollects client dependencies in a normalgenerateBundlehook. Vite's CSS postprocessing subsequently removes pure CSS chunks and updates imports. Running this asset-manifest hook withorder: "post"resolves the reproduced missing-module requests while retaining the shared CSS dependency. Both client navigation and a warm-cache reload pass in the fixture after that change.Is moving this hook after CSS postprocessing the appropriate upstream fix, or is another supported configuration intended? This is separate from stylesheet crossorigin issue #1464. We currently keep a source/version-checked local patch and will remove it after a released upstream correction passes the reproduction.