-
-
Notifications
You must be signed in to change notification settings - Fork 189
Labels
Description
Regression from #794
When testing latest, I found many build failures in wakujs/waku#1655.
For example, react-tweet
causes a following error:
https://stackblitz.com/edit/github-8f2jxtdr?file=src%2Froot.tsx
error during build:
[rsc:use-client/build-references] Could not load virtual:vite-rsc/client-references (imported by ../../dist/browser-QU10IP0-.js): Cannot read properties of undefined (reading 'replaceAll')
at Object.load (file:///home/hiroshi/code/others/vite-plugin-react/packages/plugin-rsc/dist/plugin-CNxA7P6H.js:1322:28)
meta.serverChunk
is expected to exist and name to be a proper string
, but apparently not.
vite-plugin-react/packages/plugin-rsc/src/plugin.ts
Lines 1229 to 1236 in 2dd0993
let name = | |
useClientPluginOptions.clientChunks?.({ | |
id: meta.importId, | |
normalizedId: manager.toRelativeId(meta.importId), | |
serverChunk: meta.serverChunk!, | |
}) ?? meta.serverChunk! | |
// ensure clean virtual id to avoid interfering with other plugins | |
name = cleanUrl(name.replaceAll('..', '__')) |