Skip to content

Instantly share code, notes, and snippets.

@acusti
Created May 18, 2026 16:53
Show Gist options
  • Select an option

  • Save acusti/b2c6d629a44f356ef81dbd0329d03dd0 to your computer and use it in GitHub Desktop.

Select an option

Save acusti/b2c6d629a44f356ef81dbd0329d03dd0 to your computer and use it in GitHub Desktop.
Minimal repro: Cloudflare Vite plugin edge-preview rejects worker with DO bindings + remote bindings (2026-05-18 regression)
{
"name": "edge-preview-do-repro",
"private": true,
"type": "module",
"scripts": { "dev": "vite" },
"devDependencies": {
"@cloudflare/vite-plugin": "1.37.1",
"vite": "^8",
"wrangler": "4.92.0"
}
}
import { cloudflare } from '@cloudflare/vite-plugin';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [cloudflare({ viteEnvironment: { name: 'ssr' } })],
});
import { DurableObject } from 'cloudflare:workers';
export class MyDO extends DurableObject {
async hello() { return 'hi'; }
}
export default {
async fetch(_req: Request, env: { MY_DO: DurableObjectNamespace; AI: Ai }) {
return new Response('ok');
},
} satisfies ExportedHandler;
{
"$schema": "https://unpkg.com/wrangler@latest/config-schema.json",
"name": "edge-preview-do-repro",
"main": "./worker.ts",
"compatibility_date": "2026-05-15",
"compatibility_flags": ["nodejs_compat"],
"ai": { "binding": "AI", "remote": true },
"durable_objects": {
"bindings": [
{ "name": "MY_DO", "class_name": "MyDO" }
]
},
"migrations": [
{ "tag": "v1", "new_sqlite_classes": ["MyDO"] }
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment