cloudflare / cloudflare/vinext
RSC streaming crash: enqueueModel is not a function (multi-route App Router)
- Dominant language
- TypeScript
- Stars
- 8.8k
- Forks
- 406
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 120
Description
## Bug
App Router dev server crashes with `chunk.reason.enqueueModel is not a function` on all routes when the app has more than 1-2 pages.
Single-page apps work perfectly. Adding sibling routes breaks ALL routes including ones that previously worked.
## Environment
- vinext: 0.0.34
- vite: 7.3.1
- react: 19.2.4
- react-dom: 19.2.4
- react-server-dom-webpack: 19.2.4
- @cloudflare/vite-plugin: 1.30.0
- @vitejs/plugin-rsc: 0.5.21
- Node.js: 24.6.0
- macOS Darwin 25.3.0
## Reproduction
**vite.config.ts** (matches examples/app-router-cloudflare):
```ts
import { defineConfig } from "vite";
import vinext from "vinext";
import { cloudflare } from "@cloudflare/vite-plugin";
export default defineConfig({
plugins: [
vinext(),
cloudflare({
viteEnvironment: { name: "rsc", childEnvironments: ["ssr"] },
}),
],
});
```
### Works (single route):
```
app/
layout.tsx # simple html/body
page.tsx #
Hello
```
→ `GET /` returns 200 with rendered HTML
### Fails (multiple routes):
```
app/
layout.tsx
page.tsx # homepage with imports
about/
page.tsx #
About
donate/
page.tsx #
Donate
```
→ ALL routes return 500 with:
```
chunk.reason.enqueueModel is not a function
at resolveModelChunk (node_modules/.vite/deps_ssr/react-server-dom-webpack_client__edge.js)
at processFullBinaryRow
at progress
```
### Also tested:
- Dynamic segments `[locale]` → same error
- Flat static routes only → same error when >2 routes
- With/without nested layouts → same error
- vite-plus 0.1.12 → same error
- Cleared `.vite` cache between tests → same error
## Expected behavior
Multi-route App Router apps should render all pages without RSC streaming errors.
## Additional context
The error is in the SSR dep-optimized version of `react-server-dom-webpack_client__edge.js`. The `resolveModelChunk` function at line ~995 calls `chunk.reason.enqueueModel()` but `chunk.reason` doesn't have this method when processing RSC payloads for apps with multiple route entries.
Contributor guide
Assessment
This issue has not been assessed yet.