{"record":{"id":"94fa8065799019d4","repo":"anomalyco/sst","slug":"found-file-in-path-resolve-sitepath-for","errorCode":null,"errorMessage":"Found ${file} in \"${path.resolve(sitePath)}\" for ${componentName}.\n\nRemove it to avoid interfering with SST managed wrangler configurations:\nhttps://sst.dev/docs/cloudflare/#cloudflare-vite-plugin","messagePattern":"Found (.+?) in \"(.+?)\" for (.+?)\\.\n\nRemove it to avoid interfering with SST managed wrangler configurations:\nhttps://sst\\.dev/docs/cloudflare/#cloudflare-vite-plugin","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/cloudflare/helpers/validation.ts","lineNumber":15,"sourceCode":"import fs from \"fs\";\nimport path from \"path\";\nimport { VisibleError } from \"../../error.js\";\n\n/**\n * Validates that no wrangler configuration file exists in the site directory.\n * SST manages wrangler configuration automatically and user-provided files can cause conflicts.\n */\nexport function validateNoWranglerFile(sitePath: string, componentName: string): void {\n  const wranglerFiles = [\"wrangler.toml\", \"wrangler.json\", \"wrangler.jsonc\"];\n\n  for (const file of wranglerFiles) {\n    const filePath = path.join(sitePath, file);\n    if (fs.existsSync(filePath)) {\n      throw new VisibleError(\n        [\n          `Found ${file} in \"${path.resolve(sitePath)}\" for ${componentName}.`,\n          \"\",\n          \"Remove it to avoid interfering with SST managed wrangler configurations:\",\n          `https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin`,\n        ].join(\"\\n\"),\n      );\n    }\n  }\n}\n\n/**\n * Validates that the framework config file contains the required SST_WRANGLER_PATH configuration.\n * This ensures linked resources work correctly in Cloudflare SSR sites.\n */\nexport function validateFrameworkConfig(input: {\n  sitePath: string;\n  configName: string;","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/cloudflare/helpers/validation.ts#L1-L33","documentation":"SST manages the Cloudflare wrangler configuration itself for framework sites, so a user-checked-in wrangler.toml/json/jsonc in the site directory would conflict with or override SST's generated config. The component fails fast at validation time.","triggerScenarios":"validateNoWranglerFile finds `wrangler.toml`, `wrangler.json`, or `wrangler.jsonc` in the site's source path when synthesizing a Cloudflare framework site (Vite/Astro/SolidStart etc.).","commonSituations":"Project previously deployed with the Cloudflare Vite plugin or wrangler CLI directly, leaving a wrangler config behind; scaffolding tools (e.g. `npm create cloudflare`) generate wrangler.jsonc by default; migrating an existing Workers project into SST.","solutions":["Delete the wrangler.toml/json/jsonc from the site directory and let SST manage the config.","Move any needed custom settings into the SST component's args instead of wrangler config.","Check subdirectories referenced as the site `path` for stray wrangler files too."],"exampleFix":"// before\nmy-app/\n  wrangler.jsonc   # <- delete this\n  vite.config.ts\n// after\nmy-app/\n  vite.config.ts   # configPath: process.env.SST_WRANGLER_PATH in the SST adapter\n","handlingStrategy":"validation","validationCode":"import fs from \"fs\"; import path from \"path\";\nconst sitePath = \"my-app\";\nfor (const f of [\"wrangler.toml\", \"wrangler.json\", \"wrangler.jsonc\"])\n  if (fs.existsSync(path.join(sitePath, f))) console.warn(`Remove ${f} before deploy`);","typeGuard":null,"tryCatchPattern":"try {\n  new sst.cloudflare.Vite(app, \"Site\", { path: sitePath });\n} catch (e) {\n  if (String(e).includes(\"wrangler\")) console.error(\"Delete the checked-in wrangler config\");\n  else throw e;\n}","preventionTips":["Never commit wrangler.toml/jsonc in SST-managed framework sites.","Add wrangler.* to .gitignore in framework site dirs.","Move wrangler settings into SST component args."],"tags":["cloudflare","wrangler","vite-plugin","conflicting-config","sst-config"],"backgroundTag":"conflicting-wrangler-config","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}