You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pnpm: dev warns "Failed to resolve dependency: @vitejs/plugin-rsc/vendor/react-server-dom/static.edge" in a fresh Cloudflare template #1050
A freshly scaffolded Cloudflare template, installed with pnpm, prints this on pnpm dev:
Failed to resolve dependency: @vitejs/plugin-rsc/vendor/react-server-dom/static.edge, present in rsc 'optimizeDeps.include'
The app still serves (GET / returns 200). I saw no effect beyond the warning, but I did not look for one.
Reproduce
pnpm create rango@latest my-app --template cloudflare --package-manager pnpm
cd my-app
pnpm install
pnpm dev
Cause, as far as I traced it
@rangojs/router depends on @vitejs/plugin-rsc, and also declares it as a required peer (^0.5.35).
The template's package.json does not list it. pnpm installs it for Rango but does not link it at the project root: node_modules/@vitejs contains only plugin-react.
The optimizeDeps.include entry that fails is @vitejs/plugin-rsc/vendor/react-server-dom/static.edge. It appears to come from @vitejs/plugin-rsc itself, which refers to its own vendored files by package name. Rango's own source only references react-dom/static.edge.
Vite resolves that entry from the project root, where the package is not present.
Confirmed fix on the app side
pnpm add -D @vitejs/plugin-rsc@^0.5.35
After this the warning is gone and the page still serves.
Possible fixes
Add @vitejs/plugin-rsc to the templates' devDependencies (the templates live in rangojs/templates), and to the install commands in the README and the cloudflare skill. This matches the package declaring it a required peer.
Have rango() make that entry resolvable through @rangojs/router, for example with Vite's nested form (@rangojs/router > @vitejs/plugin-rsc/vendor/...). This matches the README, which says "rango() includes @vitejs/plugin-rsc" and tells the user to install only @rangojs/router, react, react-dom and vite.
The README and the peer declaration currently disagree on whether the app is expected to install @vitejs/plugin-rsc; either fix would settle that.
Environment
@rangojs/router 0.20.0, create-rango 0.2.4
@vitejs/plugin-rsc 0.5.35, vite 8.3.2, @cloudflare/vite-plugin 1.62.5
pnpm 10.34.5, Node 24.12.0, macOS
Not checked
npm or yarn, where a flat node_modules may hide this.
Activity