-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Labels
bugSomething that isn't workingSomething that isn't workingvite-pluginRelating to the `@cloudflare/vite-plugin` packageRelating to the `@cloudflare/vite-plugin` package
Description
Which Cloudflare product(s) does this pertain to?
Vite Plugin
What versions & operating system are you using?
WSL2 windows
Please provide a link to a minimal reproduction
No response
Describe the Bug
when running npm run build, in a cloudflare workers react-router v7 project, I get the following exception:
Using Vite Environment API (experimental)
vite v6.2.6 building for production...
transforming (147) node_modules/lucide-react/dist/esm/icons/chart-bar.js11:05:57 AM [vite] (ssr) ✨ new dependencies optimized: react-router, @iconify-icon/react/dist/iconify.mjs, @iconify-icon/react, lucide-react, react, next-themes, react-dom
11:05:57 AM [vite] (ssr) ✨ optimized dependencies changed. reloading
11:05:57 AM [vite] (ssr) error while updating dependencies:
AssertionError [ERR_ASSERTION]: The WebSocket is undefined
at Object.send (file:///home/ubuntu/sde/workspace/humsub-website-rr/node_modules/@cloudflare/vite-plugin/dist/index.js:13064:7)
at Object.send (file:///home/ubuntu/sde/workspace/humsub-website-rr/node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js:44632:23)
at fullReload (file:///home/ubuntu/sde/workspace/humsub-website-rr/node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js:52484:21)
at runOptimizer (file:///home/ubuntu/sde/workspace/humsub-website-rr/node_modules/vite/dist/node/chunks/dep-Bid9ssRr.js:52467:11)
at processTicksAndRejections (node:internal/process/task_queues:105:5
Here is my wrangler.json
{
"$schema": "https://unpkg.com/wrangler@latest/config-schema.json",
"name": "website-rr",
"main": "./app/entry.worker.ts",
"compatibility_date": "2025-04-07",
"compatibility_flags": ["nodejs_compat"],
"workers_dev": true,
"dev": { "port": 3000 },
"placement": { "mode": "off" },
"observability": { "enabled": true },
"assets": { "directory": "./build/client", "binding": "ASSETS" },
"kv_namespaces": [{ "binding": "KV", "id": "...." }]
}
It's important to note that, the project doesn't do anything with websockets by itself.
https://github.com/cloudflare/workers-sdk/blob/d04c69f81eb40a854c219fdcad53e0387ca5f2e2/packages/vite-plugin-cloudflare/src/cloudflare-environment.ts#L47C4-L48C1
Please provide any relevant error logs
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething that isn't workingSomething that isn't workingvite-pluginRelating to the `@cloudflare/vite-plugin` packageRelating to the `@cloudflare/vite-plugin` package
Type
Projects
Status
Done