Skip to content

RSC streaming crash: enqueueModel is not a function (multi-route App Router) #672

@M1chaelTran

Description

@M1chaelTran

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):

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      # <h1>Hello</h1>

GET / returns 200 with rendered HTML

Fails (multiple routes):

app/
  layout.tsx
  page.tsx      # homepage with imports
  about/
    page.tsx    # <h1>About</h1>
  donate/
    page.tsx    # <h1>Donate</h1>

→ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions