As of 2025 November, developing SvelteKit with Cloudflare Durable Object is non-trivial due to several limitations:
Thus, our best bet is to have a separate worker that proxies Durable Object methods via Cloudflare's Service binding API. This repo demonstrates exactly that.
pnpm. Install via volta is recommended.
Install dependencies (at project root):
pnpm install
Start worker dev server:
cd worker
pnpm dev
Start SvelteKit dev server:
cd sveltekit
pnpm dev
Open SvelteKit at http://localhost:517X should yield output from Durable Object. Data flow is as
follows:
src/routes/+page.server.ts: calls worker RPC method via the WORKER service binding (see sveltekit/wrangler.jsonc).worker/src/worker.ts: worker service binding calls RPC method on Durable Object.