mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #185] RSC moduleMap undefined on first request: Cannot read properties of undefined (reading 'moduleMap') #41
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @justinfinnn on GitHub (Feb 28, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/185
Bug
After a successful
vinext deploy, the deployed Worker crashes on every request with:HTTP response:
500 error code: 1101(Worker threw an unhandled exception)Environment
vinext deployorwrangler deploy --config dist/server/wrangler.json)Steps to reproduce
vinext buildcompletes successfullywrangler deployusing the generateddist/server/wrangler.jsonCannot read properties of undefined (reading 'moduleMap')from the RSC layerRoot cause (suspected)
The RSC client manifest / module map is not being correctly initialized or passed between the RSC server layer and the SSR edge environment. The
dist/server/worker attempts to use the module map before it's populated.Workaround
Use Next.js
output: 'export'(static export) and deploy theout/directory as a static asset Worker:This bypasses RSC/SSR entirely and works reliably, though it sacrifices server-side rendering.
Expected behavior
The deployed Worker should serve the app successfully without RSC initialization errors.
@StringerBell69 commented on GitHub (Feb 28, 2026):
This appears to be a React version compatibility issue, react-server-dom-webpack requires react@^19.2.4 for RSC support, but you're on react@19.2.0. Try upgrading React with npm install react@latest react-dom@latest and redeploy.
If the issue persists after upgrading, it may be a @vitejs/plugin-rsc or @cloudflare/vite-plugin issue with module map initialization in the Workers runtime, in that case, file a bug on the relevant plugin repo.
@StringerBell69 commented on GitHub (Feb 28, 2026):
Your repro uses vinext build + wrangler deploy manually, which bypasses the React compatibility checks that vinext deploy performs automatically.