Skip to content

@vitejs/plugin-rsc serve fails with @cloudflare/vite-plugin since v1.15.0 #11359

@hamlim

Description

@hamlim

What versions & operating system are you using?

  System:
    OS: macOS 26.2
    CPU: (8) arm64 Apple M2
    Memory: 716.63 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.8.0 - /Users/matt/.local/state/fnm_multishells/1995_1763609249212/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 11.6.0 - /Users/matt/.local/state/fnm_multishells/1995_1763609249212/bin/npm
    pnpm: 10.6.5 - /Users/matt/Library/pnpm/pnpm
    bun: 1.3.1 - /Users/matt/.local/share/mise/installs/bun/1.3.1/bin/bun
    Deno: 2.3.3 - /Users/matt/.deno/bin/deno
  npmPackages:
    @cloudflare/vite-plugin: 1.15.0 => 1.15.0 

Please provide a link to a minimal reproduction

hamlim/vite-plugin-react#1

Describe the Bug

Running vite (e.g. bun run dev, where dev script runs vite) results in the following error and the process exits:

error when starting dev server:
TypeError: Cannot read properties of null (reading 'local')
    at CustomModuleRunner.cachedModule (workers/runner-worker.js:1238:20)
    at request (workers/runner-worker.js:1156:83)
    at null.<anonymous> (/worker-entry/virtual:cloudflare/worker-entry:4:1)
    at Object.runInlinedModule (workers/runner-worker.js:1339:4)
    at CustomModuleRunner.directRequest (workers/runner-worker.js:1210:59)
    at CustomModuleRunner.cachedRequest (workers/runner-worker.js:1117:73)
    at CustomModuleRunner.import (workers/runner-worker.js:1067:10)
    at getWorkerEntryExportTypes (workers/runner-worker.js:1371:24)
    at null.<anonymous> (workers/runner-worker.js:1495:37)
    at maybeCaptureError (workers/runner-worker.js:47:10)

To reproduce with the above reproduction;

  • clone the repo
  • install deps via pnpm i
  • build the rsc plugin / local packages via pnpm run build
  • cd into the example: cd packages/plugin-rsc/examples/starter-cf-single/
  • run pnpm run dev to start the dev server and see the bug

Please provide any relevant error logs

When debugging within the rsc plugin, I see server.resolvedUrls is null, which fails this assertion in the rsc plugin: https://github.com/vitejs/vite-plugin-react/blob/87557115710b060ee9f534300a7209ddc62be9cf/packages/plugin-rsc/src/plugin.ts#L732

The primary change in that release seems to be this one: #11238, which does sound like it changes aspects of the dev server possibly?

Metadata

Metadata

Assignees

Labels

vite-pluginRelating to the `@cloudflare/vite-plugin` package

Type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions