cloudflare / cloudflare/cloudflare-docs

Sveltekit deploy docs not working

Open
#30,693 3 comments 3 reactions 6 assignees Claimed by @WalshyDev View on GitHub
content:edit documentation product:workers stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Existing documentation URL(s)

- https://developers.cloudflare.com/workers/framework-guides/web-apps/sveltekit/

### What changes are you suggesting?

I tried running `npx wrangler deploy` as this page mentioned: https://developers.cloudflare.com/workers/framework-guides/web-apps/sveltekit/. But it errors due to a types file not existing:

```

sabihsarowar@Sabihs-Mac-mini construction-notion-map % npx wrangler deploy

⛅️ wrangler 4.90.0
───────────────────

Detected Project Settings:
- Worker Name: parse-text-from-any-block-type
- Framework: SvelteKit
- Build Command: npm run build
- Output Directory: build

✔ Do you want to modify these settings? … yes
✔ What do you want to name your Worker? … construction-notion-map
✔ What framework is your application using? › SvelteKit
✔ What directory contains your applications' output/asset files? … build
✔ What is your application's build command? … npm run build

Updated Project Settings:
- Worker Name: construction-notion-map
- Framework: SvelteKit
- Build Command: npm run build
- Output Directory: build

📦 Install packages:
- wrangler (devDependency)

📝 Update package.json scripts:
- "deploy": "npm run build && wrangler deploy"
- "preview": "npm run build && wrangler dev"

📄 Create wrangler.jsonc:
{
"$schema": "node_modules/wrangler/config-schema.json",
"name": "construction-notion-map",
"compatibility_date": "2026-05-08",
"observability": {
"enabled": true
},
"main": ".svelte-kit/cloudflare/_worker.js",
"assets": {
"binding": "ASSETS",
"directory": ".svelte-kit/cloudflare"
},
"compatibility_flags": [
"nodejs_compat"
]
}

🛠️ Configuring project for SvelteKit with "sv add"

✔ Proceed with setup? … yes
├ Installing wrangler A command line tool for building Cloudflare Workers
│ installed via `npm install wrangler --save-dev`

├ Installing adapter
│ installed via `npx sv add sveltekit-adapter=adapter:cloudflare+cfTarget:workers`

├ Installing packages
│ installed

[build] Running: npm run build
[build]
[build] > parse-text-from-any-block-type@0.0.1 build
[build] > wrangler types --check && vite build
[build]
[build]
[build]
[build] ⛅️ wrangler 4.90.0
[build] ───────────────────
[build]
[build]
[build]
[build] ✘ [ERROR] Types file not found at worker-configuration.d.ts.
[build]
[build]
[build]
[build] 🪵 Logs were written to "/Users/sabihsarowar/Library/Preferences/.wrangler/logs/wrangler-2026-05-08_01-00-47_859.log"
[build]
✘ [ERROR] Error: Command failed with exit code 1: npm run build

✘ [ERROR] Types file not found at
worker-configuration.d.ts.

🪵 Logs were written to
"/Users/sabihsarowar/Library/Preferences/.wrangler/logs/wrangler-2026-05-08_01-00-47_859.log"

> parse-text-from-any-block-type@0.0.1 build
> wrangler types --check && vite build

⛅️ wrangler 4.90.0
───────────────────

at makeError
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:55064:18)
at handlePromise
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:55531:29)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async runCommand
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:136924:5)
at async runAutoConfig
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:234907:7)
at async Object.handler
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:236237:41)
at async
/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:184532:26
at async Object.handler
(/Volumes/ssd/coding/construction-notion-map/node_modules/wrangler/wrangler-dist/cli.js:184481:7)
{
shortMessage: 'Command failed with exit code 1: npm run build',
command: 'npm run build',
escapedCommand: 'npm run build',
exitCode: 1,
signal: undefined,
signalDescription: undefined,
stdout: '\n' +
'> parse-text-from-any-block-type@0.0.1 build\n' +
'> wrangler types --check && vite build\n' +
'\n' +
'\n' +
' ⛅️ wrangler 4.90.0\n' +
'───────────────────\n',
stderr: '\x1B[31m✘ \x1B[41;31m[\x1B[41;97mERROR\x1B[41;31m]\x1B[0m \x1B[1mTypes file not found
at worker-configuration.d.ts.\x1B[0m\n' +
'\n' +
'\n' +
'🪵 Logs were written to
"/Users/sabihsarowar/Library/Preferences/.wrangler/logs/wrangler-2026-05-08_01-00-47_859.log"',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}

✘ [ERROR] Running custom build `npm run build` failed. There are likely more logs from your build command above.

🪵 Logs were written to "/Users/sabihsarowar/Library/Preferences/.wrangler/logs/wrangler-2026-05-08_01-00-31_905.log"
```

see the line `file not found at worker-configuration.d.ts`

running `npm run build` separately gives this:

```
sabihsarowar@Sabihs-Mac-mini construction-notion-map % npm run build

> parse-text-from-any-block-type@0.0.1 build
> wrangler types --check && vite build

⛅️ wrangler 4.90.0
───────────────────

✘ [ERROR] Types file not found at worker-configuration.d.ts.

🪵 Logs were written to "/Users/sabihsarowar/Library/Preferences/.wrangler/logs/wrangler-2026-05-08_01-05-42_696.log"
```

There should be a step for this in the instructions

### Additional information

solution was to write `npx wrangler types` like how `https://developers.cloudflare.com/workers/languages/typescript/` tells me to before `npx wrangler deploy`. maybe the types command should be ran in the `npx wrangler deploy` command?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.