anomalyco/sst · error · VisibleError
Missing required configuration for ${componentName}. The Cl
Error message
Missing required configuration for ${componentName}.
The Cloudflare adapter must be configured with:
configPath: process.env.SST_WRANGLER_PATH,
This is required for linked resources to work correctly:
https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin What it means
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.
Source
Thrown at platform/src/components/cloudflare/helpers/validation.ts:62
const candidate = path.join(configDir, `${configName}${ext}`);
if (fs.existsSync(candidate)) {
configPath = candidate;
break;
}
}
if (!configPath) {
throw new VisibleError(
`Could not find config file for ${componentName} in "${path.resolve(configDir)}".\nExpected one of: ${extensions.map(e => `${configName}${e}`).join(", ")}.`
);
}
// Read and check for SST_WRANGLER_PATH pattern
const content = fs.readFileSync(configPath, "utf-8");
const hasWranglerPath = /configPath\s*[:=]\s*process\.env\.SST_WRANGLER_PATH/.test(content);
if (!hasWranglerPath) {
throw new VisibleError(
[
`Missing required configuration for ${componentName}.`,
"",
`The Cloudflare adapter must be configured with:`,
` configPath: process.env.SST_WRANGLER_PATH,`,
"",
`This is required for linked resources to work correctly:`,
`https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin`,
].join("\n")
);
}
}
View on GitHub (pinned to a0bd20f762)
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.
Example fix
// before (vite.config.ts)
cloudflare({ viteEnvironment: { name: "ssr" } });
// after
cloudflare({
viteEnvironment: { name: "ssr" },
configPath: process.env.SST_WRANGLER_PATH,
}); Defensive patterns
Strategy: validation
Validate before calling
const content = fs.readFileSync("vite.config.ts", "utf-8");
if (!/configPath\s*[:=]\s*process\.env\.SST_WRANGLER_PATH/.test(content))
throw new Error("Add configPath: process.env.SST_WRANGLER_PATH to the cloudflare plugin"); Try / catch
try {
new sst.cloudflare.Vite(app, "Site", { path: "." });
} catch (e) {
if (String(e).includes("SST_WRANGLER_PATH")) console.error("Add configPath: process.env.SST_WRANGLER_PATH to plugin options");
else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- Found ${file} in "${path.resolve(sitePath)}" for ${component
- SSR server bundle not found in the build output at: "${pat
- You cannot provide both "job" and "worker" in the "${name}"
- You must provide a "worker" for the "${name}" Cron component
- SolidStart's nitro.config.ts must be configured to use the "
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/486302d6af04491e.
Report an issue: GitHub.