adapter-cloudflare@8: dev server crashes on Deno ("Cannot set property caches of #<Window> which has only a getter")
Maintainers usually reply within 1 day
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
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:
- Create a new project using
npx sv create, selectdenowhen the option is presented - Install
adapter-cloudflareusingnpx sv add sveltekit-adapter="adapter:cloudflare", selectdenoandworkerswhen the options are presented - Run
deno task genas advised by the cli - Run
deno task devto 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
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sveltejs/kit
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
adapter-cloudflare: `cloudflare:workers` keeps using the old platform proxy after the Wrangler config reloads in devPossibly taken @svelte-triage-bot claimed this 10 days ago. Openpkg:adapter-cloudflare
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sveltejs/kit#17529 · 1 comment ·
Maintainers usually reply within 1 day
-
svelte-package watch mode leaves the compiled .js of a deleted .ts file in the outputPossibly taken @svelte-triage-bot claimed this 12 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
sveltejs/kit#17518 · 1 comment ·
Maintainers usually reply within 1 day
-
Prerendering no longer shows progressMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
sveltejs/kit#17163 · 4 comments ·
Maintainers usually reply within 1 day
-
sync: concurrent runs can read a truncated route_meta_data.json (JSON.parse error)Possibly taken @Nic-Polumeyv claimed this 37 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
Similar issues
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LucasSantana-Dev/Lucky#2945 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
brijeshb42/monaco-vim#175 ·
-
good first issue
Difficulty 2/5 3-5 days Newbie friendliness 62/100
paipai1999/POS-system#3 ·
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
r-afael/better-yt-recommendations#36 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
microsoft/playwright#43875 · 1 comment ·
Maintainers usually reply within 1 day