anomalyco/sst · error · VisibleError
Site directory not found at "${path.resolve(sitePath)}". Ple
Error message
Site directory not found at "${path.resolve(sitePath)}". Please check the path setting in your configuration. What it means
SSR site components take a `path` prop pointing to the app's source directory. Before building, SST checks that this directory exists on disk; if `fs.existsSync` fails, it throws with the absolute resolved path so you can see exactly what it looked for.
Source
Thrown at platform/src/components/aws/ssr-site.ts:1209
outputs: {
title: devArgs.title,
command: output(devArgs.command ?? "npm run dev"),
autostart: output(devArgs.autostart ?? true),
directory: output(devArgs.directory ?? sitePath),
environment: args.environment,
links: output(args.link || [])
.apply(Link.build)
.apply((links) => links.map((link) => link.name)),
},
};
}
function normalizeSitePath() {
return output(args.path).apply((sitePath) => {
if (!sitePath) return ".";
if (!fs.existsSync(sitePath)) {
throw new VisibleError(
`Site directory not found at "${path.resolve(
sitePath,
)}". Please check the path setting in your configuration.`,
);
}
return sitePath;
});
}
function normalizeRegions() {
return output(
args.regions ?? [getRegionOutput(undefined, { parent: self }).region],
).apply((regions) => {
if (regions.length === 0)
throw new VisibleError(
"No deployment regions specified. Please specify at least one region in the 'regions' property.",
);
View on GitHub (pinned to a0bd20f762)
Solutions
- Fix the `path` value in the site component args to point at the app directory containing package.json
- Confirm the directory exists relative to the sst.config.ts location (`ls <path>`)
- Check for typos and case sensitivity in the path
Example fix
// before
new sst.aws.NextjsSite("Web", { path: "apps/webs" });
// after
new sst.aws.NextjsSite("Web", { path: "apps/web" }); Defensive patterns
Strategy: validation
Validate before calling
import { existsSync, statSync } from "fs";
const sitePath = "apps/web";
if (!existsSync(sitePath) || !statSync(sitePath).isDirectory()) {
throw new Error(`Site path does not exist: ${sitePath}`);
} Try / catch
try {
new sst.aws.NextjsSite("Web", { path: sitePath });
} catch (e) {
if (String(e).includes("Site directory not found")) console.error(`Check path: ${sitePath}`);
throw e;
} Prevention
- Run sst.config.ts from the repo root and use paths relative to it
- In monorepos, verify the app folder path after any restructure
- Add a predeploy check that each site path exists
When it happens
Trigger: Deploying an SSR site component whose `path` points to a nonexistent directory (typo, wrong relative path, app moved/renamed, site built from a monorepo root instead of the package dir).
Common situations: Monorepo restructures (moving apps into packages/app); running sst from a different working directory than expected; case-sensitivity mismatches on Linux CI; forgetting to rename the folder after cloning a template.
Related errors
- No deployment regions specified. Please specify at least one
- You cannot provide both "job" and "function" in the "${name}
- You cannot provide both a function and a task in the "${name
- You must provide either a function or a task in the "${name}
- You cannot provide both "job" and "function" in the "${name}
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/4f72131a398cf9df.
Report an issue: GitHub.