anomalyco/sst · error · VisibleError
Found ${file} in "${path.resolve(sitePath)}" for ${component
Error message
Found ${file} in "${path.resolve(sitePath)}" for ${componentName}.
Remove it to avoid interfering with SST managed wrangler configurations:
https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin What it means
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.
Source
Thrown at platform/src/components/cloudflare/helpers/validation.ts:15
import fs from "fs";
import path from "path";
import { VisibleError } from "../../error.js";
/**
* Validates that no wrangler configuration file exists in the site directory.
* SST manages wrangler configuration automatically and user-provided files can cause conflicts.
*/
export function validateNoWranglerFile(sitePath: string, componentName: string): void {
const wranglerFiles = ["wrangler.toml", "wrangler.json", "wrangler.jsonc"];
for (const file of wranglerFiles) {
const filePath = path.join(sitePath, file);
if (fs.existsSync(filePath)) {
throw new VisibleError(
[
`Found ${file} in "${path.resolve(sitePath)}" for ${componentName}.`,
"",
"Remove it to avoid interfering with SST managed wrangler configurations:",
`https://sst.dev/docs/cloudflare/#cloudflare-vite-plugin`,
].join("\n"),
);
}
}
}
/**
* Validates that the framework config file contains the required SST_WRANGLER_PATH configuration.
* This ensures linked resources work correctly in Cloudflare SSR sites.
*/
export function validateFrameworkConfig(input: {
sitePath: string;
configName: string;View on GitHub (pinned to a0bd20f762)
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.
Example fix
// before my-app/ wrangler.jsonc # <- delete this vite.config.ts // after my-app/ vite.config.ts # configPath: process.env.SST_WRANGLER_PATH in the SST adapter
Defensive patterns
Strategy: validation
Validate before calling
import fs from "fs"; import path from "path";
const sitePath = "my-app";
for (const f of ["wrangler.toml", "wrangler.json", "wrangler.jsonc"])
if (fs.existsSync(path.join(sitePath, f))) console.warn(`Remove ${f} before deploy`); Try / catch
try {
new sst.cloudflare.Vite(app, "Site", { path: sitePath });
} catch (e) {
if (String(e).includes("wrangler")) console.error("Delete the checked-in wrangler config");
else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.).
Common situations: 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.
Related errors
- You cannot provide both "job" and "worker" in the "${name}"
- You must provide a "worker" for the "${name}" Cron component
- Could not find config file for ${componentName} in "${path.r
- Missing required configuration for ${componentName}. The Cl
- Invalid worker definition for the "${name}" Worker
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/94fa8065799019d4.
Report an issue: GitHub.