{"record":{"id":"aa871c0a8773019b","repo":"sveltejs/kit","slug":"you-must-remove-all-site-keys-in-config-path","errorCode":null,"errorMessage":"You must remove all `site` keys in ${config_path}. Consult https://svelte.dev/docs/kit/adapter-cloudflare#Migrating-from-Workers-Sites","messagePattern":"You must remove all `site` keys in (.+?)\\. Consult https://svelte\\.dev/docs/kit/adapter-cloudflare#Migrating-from-Workers-Sites","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/adapter-cloudflare/utils.js","lineNumber":27,"sourceCode":"\t\treturn true;\n\t}\n\n\tif (!!process.env.WORKERS_CI || wrangler_config.main || wrangler_config.assets) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\n/**\n * @param {import('wrangler').Unstable_Config} wrangler_config\n */\nexport function validate_worker_settings(wrangler_config) {\n\tconst config_path = wrangler_config.configPath || 'your wrangler.jsonc file';\n\n\t// we don't support workers sites\n\tif (wrangler_config.site) {\n\t\tthrow new Error(\n\t\t\t`You must remove all \\`site\\` keys in ${config_path}. Consult https://svelte.dev/docs/kit/adapter-cloudflare#Migrating-from-Workers-Sites`\n\t\t);\n\t}\n\n\t// we need the `assets.directory` key so that the static assets are deployed\n\tif ((wrangler_config.main || wrangler_config.assets) && !wrangler_config.assets?.directory) {\n\t\tthrow new Error(\n\t\t\t`You must specify the \\`assets.directory\\` key in ${config_path}. Consult https://developers.cloudflare.com/workers/static-assets/binding/#directory`\n\t\t);\n\t}\n\n\t// we need the `assets.binding` key so that the Worker can access the static assets\n\tif (wrangler_config.main && !wrangler_config.assets?.binding) {\n\t\tthrow new Error(\n\t\t\t`You must specify the \\`assets.binding\\` key in ${config_path} before deploying your Worker. Consult https://developers.cloudflare.com/workers/static-assets/binding/#binding`\n\t\t);\n\t}\n","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-cloudflare/utils.js#L9-L45","documentation":"adapter-cloudflare no longer supports Cloudflare Workers Sites (the legacy `site` config that uploads a static asset directory via KV). The adapter validates the wrangler config at build time and refuses to proceed when any `site` key is present, directing you to migrate to Workers Static Assets (`assets.directory`).","triggerScenarios":"Running `vite build` (the adapter's adapt step) with a wrangler.jsonc/wrangler.toml that still contains a `site` block (site.bucket, site.include, etc.).","commonSituations":"Projects upgraded from older adapter versions or migrated from a template based on Workers Sites; copying an old wrangler.toml from a non-SvelteKit Sites project.","solutions":["Delete the `site` block (and any `[site]` section in wrangler.toml) from your wrangler config.","Add an `assets.directory` key pointing at the built client assets (the adapter usually does this automatically).","Follow the migration guide at https://svelte.dev/docs/kit/adapter-cloudflare#Migrating-from-Workers-Sites.","If you intentionally need Workers Sites, stay on an older adapter version (not recommended)."],"exampleFix":"// before (wrangler.jsonc)\n{\n  \"name\": \"my-app\",\n  \"site\": { \"bucket\": \"./public\" }\n}\n\n// after\n{\n  \"name\": \"my-app\",\n  \"assets\": { \"directory\": \".svelte-kit/cloudflare\" }\n}","handlingStrategy":"validation","validationCode":"import fs from 'node:fs';\nconst cfg = JSON.parse(fs.readFileSync('wrangler.jsonc', 'utf8'));\nif (cfg.site) throw new Error('Remove all `site` keys from wrangler.jsonc before building with adapter-cloudflare');","typeGuard":"function isSitesConfig(config) {\n  return config != null && typeof config === 'object' && 'site' in config;\n}","tryCatchPattern":"try {\n  await build();\n} catch (e) {\n  if (String(e).includes('`site` keys')) {\n    console.error('Migrate from Workers Sites: remove `site`, add `assets.directory`');\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Search wrangler.jsonc/wrangler.toml for `site` after upgrading adapter versions.","Follow the adapter-cloudflare migration guide when coming from Workers Sites templates.","Let `vite build` generate the assets config rather than copying legacy configs.","Pin and read adapter changelogs for breaking config changes."],"tags":["cloudflare","wrangler-config","adapter-config","migration"],"backgroundTag":"deprecated-config-key","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}