Repository navigation
[Workers] Added workaround for SvelteKit autoconfig types file error - #34177
irvinebroque merged 1 commit into
Conversation
AI Review✅ Reviewed Commands
|
irvinebroque
left a comment
There was a problem hiding this comment.
what do we need to do to actually fix this?
@irvinebroque Thanks for the quick approval! :))) Fix: in Repro- is in the PR description (wrangler 4.149.0, sv 1.1.1). I'll remove this caution once the fix ships. |
|
Want to make a PR there in workers-sdk? |
Closes #30693
Summary
Adds a caution to the SvelteKit framework guide. It explains why the first
wrangler deployon an existing SvelteKit project fails withTypes file not found at worker-configuration.d.ts, and how to fix it.Why
When
wrangler deployautomatically configures an existing SvelteKit project, it runssv add sveltekit-adapter=adapter:cloudflare+cfTarget:workers. Since sveltejs/cli#1057, that add-on putswrangler types --checkin front of thebuildscript. Wrangler then runs the build right away, without generating types first.--checkfails becauseworker-configuration.d.tsdoes not exist yet.Reproduction with wrangler 4.149.0, sv 1.1.1 and SvelteKit 3:
npx sv create app --template minimal --types ts --no-add-onsnpx wrangler deploy: setup runs, then the build fails withTypes file not found at worker-configuration.d.tsnpx wrangler types, thennpx wrangler deploy: builds and deploys normallyThe proper fix belongs in
workers-sdk: autoconfig should run typegen aftersv addand before building (packages/autoconfig/src/frameworks/sveltekit.ts).This caution should be removed once that fix ships.
Documentation checklist