- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 10.8k
 
Closed
Description
Reproduction
https://github.com/singingwolfboy/test-cf-rr-middleware
System Info
System:
    OS: macOS 26.0.1
    CPU: (8) arm64 Apple M1
    Memory: 105.34 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 25.1.0 - /opt/homebrew/bin/node
    npm: 11.6.2 - /opt/homebrew/bin/npm
    pnpm: 10.20.0 - /opt/homebrew/bin/pnpm
    bun: 1.3.1 - /opt/homebrew/bin/bun
  Browsers:
    Firefox: 142.0.1
    Safari: 26.0.1
  npmPackages:
    @react-router/dev: ^7.9.5 => 7.9.5 
    @react-router/node: ^7.9.5 => 7.9.5 
    react-router: ^7.9.5 => 7.9.5 
    vite: ^7.1.12 => 7.1.12Used Package Manager
npm
Expected Behavior
I expect that the v8_middleware feature should work as documented, both on local development and on production, using Cloudflare Workers.
Actual Behavior
Trying to launch the dev server produces an error, as documented in the reproduction repo:
[vite] Internal server error: Failed to load url node:stream (resolved id: node:stream) in /Users/singingwolfboy/clones/test-cf-rr-middleware/node_modules/@react-router/dev/dist/config/defaults/entry.server.node.tsx. Does the file exist?
      at CustomModuleRunner.cachedModule (workers/runner-worker.js:1302:20)
      at request (workers/runner-worker.js:1152:83)
      at null.<anonymous> (/Users/singingwolfboy/clones/test-cf-rr-middleware/node_modules/@react-router/dev/dist/config/defaults/entry.server.node.tsx:1:1)
      at Object.runInlinedModule (workers/runner-worker.js:1403:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1206:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1113:73)
      at null.<anonymous> (/server-build/virtual:react-router/server-build:2:5)
      at Object.runInlinedModule (workers/runner-worker.js:1403:4)
      at CustomModuleRunner.directRequest (workers/runner-worker.js:1206:59)
      at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1113:73)
[vite] Unexpected Node.js imports for environment "ssr". Do you need to enable the "nodejs_compat" compatibility flag? Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details.
 - "node:stream" imported from "node_modules/@react-router/dev/dist/config/defaults/entry.server.node.tsx"