adapter-cloudflare@8: dev server crashes on Deno ("Cannot set property caches of #<Window> which has only a getter")

Closed Beginner friendly
#17,333 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ump45nose is already working on this.

Since Oct 10, 2026.

  • #17401 by @ump45nose — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
74/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
deno, javascript, vite
Domain
build-system

Research direction

The stack trace points at index.js:231 inside the setup hook of the adapter's minimal Vite plugin, where caches is assigned on a window-like global that Deno exposes as getter-only; the source lives in the adapter-cloudflare package in this repo. Reproduce first with the linked Deno project (deno task gen, then deno task dev) to confirm the crash, then adjust that assignment so it does not overwrite a read-only global. Done means the dev server starts under Deno without the TypeError while the adapter's existing build/tests still pass.

Written by the indexing model from the issue text.

Description

pkg:adapter-cloudflare
Describe the bug

In a new SvelteKit 3 project using adapter-cloudflare and deno, running the dev server results in the following error:

deno task dev
Task dev vite dev
(node:16327) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
error when starting dev server:
TypeError: Cannot set property caches of #<Window> which has only a getter
    at BasicMinimalPluginContext.setup (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/@[email protected]/node_modules/@sveltejs/adapter-cloudflare/index.js:231:42)
    at async _createServer (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/node.js:24883:84)
    at async CAC.<anonymous> (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/cli.js:712:18)
Reproduction

Minimal reproduction steps:

  1. Create a new project using npx sv create, select deno when the option is presented
  2. Install adapter-cloudflare using npx sv add sveltekit-adapter="adapter:cloudflare", select deno and workers when the options are presented
  3. Run deno task gen as advised by the cli
  4. Run deno task dev to run the app

See the linked public repo where I ran above exact steps and nothing more. Running deno task dev results in the error.

https://github.com/partijgedrag/cloudflare-adapter-sveltekit-3-repro

Logs
(node:16327) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
error when starting dev server:
TypeError: Cannot set property caches of #<Window> which has only a getter
    at BasicMinimalPluginContext.setup (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/@[email protected]/node_modules/@sveltejs/adapter-cloudflare/index.js:231:42)
    at async _createServer (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/chunks/node.js:24883:84)
    at async CAC.<anonymous> (file:///Users/partijgedrag/repos/partijgedrag/cloudflare-adapter-sveltekit-3-repro/node_modules/.deno/[email protected]/node_modules/vite/dist/node/cli.js:712:18)
System Info
System:
    OS: macOS 15.7.5
    CPU: (8) arm64 Apple M1 Pro
    Memory: 64.14 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.21.0 - /Users/partijgedrag/.nvm/versions/node/v24.21.0/bin/node
    Yarn: 1.22.18 - /opt/homebrew/bin/yarn
    npm: 11.19.0 - /Users/partijgedrag/.nvm/versions/node/v24.21.0/bin/npm
    pnpm: 9.9.0 - /Users/partijgedrag/Library/pnpm/pnpm
    Deno: 2.9.7 - /Users/partijgedrag/.deno/bin/deno
  Browsers:
    Chrome Canary: 157.0.8085.0
    Edge: 154.0.4258.53
    Safari: 26.4
    Safari Technology Preview: 26.0
  npmPackages:
    @sveltejs/adapter-cloudflare: ^8.0.0 => 8.0.0
    @sveltejs/kit: ^3.0.0 => 3.0.0
    @sveltejs/vite-plugin-svelte: ^7.2.0 => 7.3.1
    svelte: ^5.57.1 => 5.57.1
    vite: ^8.3.0 => 8.3.2
Severity

blocking an upgrade

Additional Information

No response

Dominant language
JavaScript
Stars
20.9k
Forks
2.4k
Avg merge
3d 8h
Merged PRs (30d)
75

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sveltejs/kit

All issues in sveltejs/kit

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.