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
`sst.cloudflare.SsrSite`-based components resolve the site directory from `args.path` (defaulting to `.`). If that directory doesn't exist on disk at synth time, SST throws this VisibleError so the misconfiguration is caught before any build runs.
Source
Thrown at platform/src/components/cloudflare/ssr-site.ts:225
const linkBindings = links.filter(Link.isLinkable).map((link) =>
output({
urn: link.urn,
link: link.getSSTLink(),
}).apply(({ urn, link }) => ({
name: urn.split("::").at(-1)!,
include: link.include ?? [],
properties: link.properties,
})),
);
return linkBindings.length > 0 ? all(linkBindings) : [];
});
}
function normalizeSitePath() {
const sitePath = args.path ?? ".";
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 createWorker() {
return new Worker(
...transform(
args.transform?.server,
`${name}Worker`,
{
environment: args.environment,
link: args.link,
accountId: args.accountId,View on GitHub (pinned to a0bd20f762)
Solutions
- Correct the `path` value to an existing directory (relative to where you run the CLI)
- Run `sst` from the repository root so relative paths resolve as intended
- Verify the app directory exists in CI (full checkout of submodules/workspace apps)
Example fix
// before
new sst.cloudflare.Nextjs('Site', { path: 'apps/webs' }); // typo
// after
new sst.cloudflare.Nextjs('Site', { path: 'apps/web' }); Defensive patterns
Strategy: validation
Validate before calling
import { existsSync } from 'fs';
const sitePath = 'apps/web';
if (!existsSync(sitePath)) throw new Error(`Site path does not exist: ${sitePath}`);
new sst.cloudflare.Nextjs('Site', { path: sitePath }); Try / catch
try {
await deploy();
} catch (e) {
if (/Site directory not found/.test(e.message)) console.error('Check `path` in your component config and your working directory');
} Prevention
- Run sst from the repository root so relative paths resolve consistently
- Double-check app directory names after renames in monorepos
- Ensure CI checks out all workspace apps
- Prefer paths relative to the repo root
When it happens
Trigger: Passing a `path` value that doesn't exist relative to the process working directory: typos in app names, referencing a monorepo app from the wrong root, or running the CLI from an unexpected cwd.
Common situations: Renaming or moving an app in a monorepo without updating sst.config.ts; CI checkout paths differing from local; absolute vs relative path confusion; deploying before submodules/apps are checked out.
Related errors
- Invalid function definition for the "${name}" Function
- Invalid function definition for the "${name}" Function
- Proxy is not enabled. Enable it with "proxy: true".
- You must provide the password to connect to your locally run
- You must provide the password to connect to your locally run
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/5365a018377a9de5.
Report an issue: GitHub.