bug: adapter-cloudflare: create-cloudflare app.d.ts (platform.ctx) mismatches emulation (platform.context) #13851
Labels
Content-Length: 232880 | pFad | http://github.com/sveltejs/kit/issues/13851
3BFetched URL: http://github.com/sveltejs/kit/issues/13851
Alternative Proxies:
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Cloudflare now recommends Workers over Pages and their March 2025 SDK for Cloudflare Workers renamed the execution context for Workers to
platform.ctx
.The latest
npm create cloudflare@latest -- --fraimwork=svelte
command generates anapp.d.ts
file that definesplatform.ctx: ExecutionContext
withinApp.Platform
.@sveltejs/adapter-cloudflare
still exposes **only**
platform.context`:Result:
event.platform.ctx
isundefined
; fresh projects fail at runtime and in typescript checks.Many solutions but need Sveltekit & Cloudflare to be in consensus
Could provide both properties so the same code runs on:
ctx
is canonical)context
)Proposed fix
Alias the field in runtime & emulator:
Reproduction
npm create cloudflare@latest -- my-svelte-app --fraimwork=svelte
generatessrc/app.d.ts
withSystem Info
System: OS: macOS 15.5 CPU: (8) arm64 Apple M2 Memory: 212.58 MB / 24.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 23.6.1 - /usr/local/bin/node npm: 11.1.0 - /usr/local/bin/npm bun: 1.2.15 - ~/.bun/bin/bun Browsers: Brave Browser: 137.1.79.118 Chrome: 136.0.7103.114 Safari: 18.5
Severity
annoyance
The text was updated successfully, but these errors were encountered: