{"record":{"id":"486302d6af04491e","repo":"anomalyco/sst","slug":"missing-required-configuration-for-componentname","errorCode":null,"errorMessage":"Missing required configuration for ${componentName}.\n\nThe Cloudflare adapter must be configured with:\n  configPath: process.env.SST_WRANGLER_PATH,\n\nThis is required for linked resources to work correctly:\nhttps://sst.dev/docs/cloudflare/#cloudflare-vite-plugin","messagePattern":"Missing required configuration for (.+?)\\.\n\nThe Cloudflare adapter must be configured with:\n  configPath: process\\.env\\.SST_WRANGLER_PATH,\n\nThis is required for linked resources to work correctly:\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":62,"sourceCode":"    const candidate = path.join(configDir, `${configName}${ext}`);\n    if (fs.existsSync(candidate)) {\n      configPath = candidate;\n      break;\n    }\n  }\n\n  if (!configPath) {\n    throw new VisibleError(\n      `Could not find config file for ${componentName} in \"${path.resolve(configDir)}\".\\nExpected one of: ${extensions.map(e => `${configName}${e}`).join(\", \")}.`\n    );\n  }\n\n  // Read and check for SST_WRANGLER_PATH pattern\n  const content = fs.readFileSync(configPath, \"utf-8\");\n  const hasWranglerPath = /configPath\\s*[:=]\\s*process\\.env\\.SST_WRANGLER_PATH/.test(content);\n\n  if (!hasWranglerPath) {\n    throw new VisibleError(\n      [\n        `Missing required configuration for ${componentName}.`,\n        \"\",\n        `The Cloudflare adapter must be configured with:`,\n        `  configPath: process.env.SST_WRANGLER_PATH,`,\n        \"\",\n        `This is required for linked resources to work correctly:`,\n        `https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin`,\n      ].join(\"\\n\")\n    );\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":75,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/cloudflare/helpers/validation.ts#L44-L75","documentation":"For linked resources to work, the Cloudflare framework adapter must be told where SST's generated wrangler config lives via `configPath: process.env.SST_WRANGLER_PATH`. SST reads the config file and greps for this pattern; when absent it throws because `sst dev`/linking would silently fail.","triggerScenarios":"validateFrameworkConfig's regex `/configPath\\s*[:=]\\s*process\\.env\\.SST_WRANGLER_PATH/` does not match the contents of the framework config — the cloudflare plugin was configured without `configPath`, hard-coded a path, or used a different expression.","commonSituations":"Following generic Cloudflare Vite plugin docs that omit configPath; upgrading SST after which the requirement was added; writing `configPath: wranglerPath` with a local variable; using a non-standard config style the regex can't see (e.g. destructured or computed value).","solutions":["Add `configPath: process.env.SST_WRANGLER_PATH` to the cloudflare plugin options in the framework config (vite.config.ts, astro.config.ts, etc.) exactly in that form.","Rebuild/redeploy after adding it.","Keep the literal `process.env.SST_WRANGLER_PATH` expression — don't alias it to another variable."],"exampleFix":"// before (vite.config.ts)\ncloudflare({ viteEnvironment: { name: \"ssr\" } });\n// after\ncloudflare({\n  viteEnvironment: { name: \"ssr\" },\n  configPath: process.env.SST_WRANGLER_PATH,\n});","handlingStrategy":"validation","validationCode":"const content = fs.readFileSync(\"vite.config.ts\", \"utf-8\");\nif (!/configPath\\s*[:=]\\s*process\\.env\\.SST_WRANGLER_PATH/.test(content))\n  throw new Error(\"Add configPath: process.env.SST_WRANGLER_PATH to the cloudflare plugin\");","typeGuard":null,"tryCatchPattern":"try {\n  new sst.cloudflare.Vite(app, \"Site\", { path: \".\" });\n} catch (e) {\n  if (String(e).includes(\"SST_WRANGLER_PATH\")) console.error(\"Add configPath: process.env.SST_WRANGLER_PATH to plugin options\");\n  else throw e;\n}","preventionTips":["Always include `configPath: process.env.SST_WRANGLER_PATH` in the cloudflare plugin options.","Keep the literal expression — don't alias the env var.","Re-run sst dev/deploy after editing the framework config."],"tags":["cloudflare","vite-plugin","sst-wrangler-path","linked-resources","configuration-required"],"backgroundTag":"missing-env-var","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}