{"record":{"id":"4f72131a398cf9df","repo":"anomalyco/sst","slug":"site-directory-not-found-at-path-resolve-sitepa","errorCode":null,"errorMessage":"Site directory not found at \"${path.resolve(sitePath)}\". Please check the path setting in your configuration.","messagePattern":"Site directory not found at \"(.+?)\"\\. Please check the path setting in your configuration\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/ssr-site.ts","lineNumber":1209,"sourceCode":"        outputs: {\n          title: devArgs.title,\n          command: output(devArgs.command ?? \"npm run dev\"),\n          autostart: output(devArgs.autostart ?? true),\n          directory: output(devArgs.directory ?? sitePath),\n          environment: args.environment,\n          links: output(args.link || [])\n            .apply(Link.build)\n            .apply((links) => links.map((link) => link.name)),\n        },\n      };\n    }\n\n    function normalizeSitePath() {\n      return output(args.path).apply((sitePath) => {\n        if (!sitePath) return \".\";\n\n        if (!fs.existsSync(sitePath)) {\n          throw new VisibleError(\n            `Site directory not found at \"${path.resolve(\n              sitePath,\n            )}\". Please check the path setting in your configuration.`,\n          );\n        }\n        return sitePath;\n      });\n    }\n\n    function normalizeRegions() {\n      return output(\n        args.regions ?? [getRegionOutput(undefined, { parent: self }).region],\n      ).apply((regions) => {\n        if (regions.length === 0)\n          throw new VisibleError(\n            \"No deployment regions specified. Please specify at least one region in the 'regions' property.\",\n          );\n","sourceCodeStart":1191,"sourceCodeEnd":1227,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/ssr-site.ts#L1191-L1227","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nnew sst.aws.NextjsSite(\"Web\", { path: \"apps/webs\" });\n// after\nnew sst.aws.NextjsSite(\"Web\", { path: \"apps/web\" });","handlingStrategy":"validation","validationCode":"import { existsSync, statSync } from \"fs\";\nconst sitePath = \"apps/web\";\nif (!existsSync(sitePath) || !statSync(sitePath).isDirectory()) {\n  throw new Error(`Site path does not exist: ${sitePath}`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  new sst.aws.NextjsSite(\"Web\", { path: sitePath });\n} catch (e) {\n  if (String(e).includes(\"Site directory not found\")) console.error(`Check path: ${sitePath}`);\n  throw e;\n}","preventionTips":["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"],"tags":["ssr-site","path","config","fs"],"backgroundTag":"directory-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}