mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #666] App Router dev still fails on raw CommonJS packages from node_modules #142
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#142
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 @southpolesteve on GitHub (Mar 23, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/666
Background
PR #665 fixes Pages Router dev for raw CommonJS packages from
node_modulesby making the direct dev module runner CommonJS-aware. App Router still fails in a separate pipeline.Reproduction
app/page.tsx:node_modules/cjs-node-package/index.js:vinext devand request/.Current result
Dev returns
500and the response includes a Vite/RSC parse error:In my repro, that surfaced from the generated/prebundled
@vitejs_plugin-rsc_vendor_react-server-dom_server__edge.jspath rather than from the package source directly.Why the Pages Router fix does not apply
createDirectRunner()inpackages/vinext/src/server/dev-module-runner.ts.@vitejs/plugin-rscplus vinext'srsc/ssrenvironments configured inpackages/vinext/src/index.ts.noExternal: true(except for explicit externals), so rawnode_modulespackages are still pushed through Vite/plugin-rsc transforms.What a fix likely needs
node_modules.rsc/ssrenvironments in dev, or transformed into valid ESM/CommonJS-compatible modules before@vitejs/plugin-rscsees them.noExternal: truein mind: CSS/assets innode_modules, RSC bundling, and React Server condition handling.Constraints / notes
@dandanthedev commented on GitHub (Mar 30, 2026):
+1, im running into this aswell