{"record":{"id":"5516d803e02da373","repo":"anomalyco/sst","slug":"tanstack-start-build-output-not-found-in-path-r","errorCode":null,"errorMessage":"TanStack Start build output not found in \"${path.resolve(outputPath)}\".\n\nExpected one of:\n  - dist/server/wrangler.json and dist/client\n  - dist/server/index.js and dist/client\n  - .output/server/index.mjs and .output/public\n\nUse the Cloudflare deployment adapter in TanStack Start, or if your project is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead.","messagePattern":"TanStack Start build output not found in \"(.+?)\"\\.\n\nExpected one of:\n  - dist/server/wrangler\\.json and dist/client\n  - dist/server/index\\.js and dist/client\n  - \\.output/server/index\\.mjs and \\.output/public\n\nUse the Cloudflare deployment adapter in TanStack Start, or if your project is entirely pre-rendered, use `sst\\.cloudflare\\.StaticSite` instead\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/cloudflare/tan-stack-start.ts","lineNumber":280,"sourceCode":"\n  protected validate(sitePath: string): void {\n    validateFrameworkConfig({\n      sitePath,\n      configName: \"vite.config\",\n      componentName: \"TanStackStart\",\n    });\n    validateNoWranglerFile(sitePath, \"TanStackStart\");\n  }\n\n  protected buildPlan(outputPath: Output<string>): Output<Plan> {\n    return outputPath.apply(async (outputPath) => {\n      const distPlan = await resolveDistPlan();\n      if (distPlan) return distPlan;\n\n      const legacyPlan = await resolveLegacyPlan();\n      if (legacyPlan) return legacyPlan;\n\n      throw new VisibleError(\n        [\n          `TanStack Start build output not found in \"${path.resolve(outputPath)}\".`,\n          \"\",\n          \"Expected one of:\",\n          \"  - dist/server/wrangler.json and dist/client\",\n          \"  - dist/server/index.js and dist/client\",\n          \"  - .output/server/index.mjs and .output/public\",\n          \"\",\n          \"Use the Cloudflare deployment adapter in TanStack Start, or if your project is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead.\",\n        ].join(\"\\n\"),\n      );\n\n      async function resolveDistPlan() {\n        const wranglerPath = path.join(\n          outputPath,\n          \"dist\",\n          \"server\",\n          \"wrangler.json\",","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/cloudflare/tan-stack-start.ts#L262-L298","documentation":"SST detects TanStack Start output by looking for dist plan layouts (`dist/server/wrangler.json` + `dist/client`, or `dist/server/index.js` + `dist/client`) and a legacy `.output/server/index.mjs` + `.output/public` layout. If none exist in the output directory, the app wasn't built with the Cloudflare deployment adapter (or legacy Nitro output), so SST throws.","triggerScenarios":"`sst deploy` on a TanStack Start project that has no `dist/` or `.output/` with server entry: building without the Cloudflare adapter, running the wrong build command, or pointing `path` at a directory without build output.","commonSituations":"Fresh TanStack Start projects built with only the default Vite SSR setup; upgrading TanStack Start where output layout changed; deploying a prerender-only app; CI skipping the app build step.","solutions":["Configure the Cloudflare deployment adapter (`@tanstack/cloudflare`) in the project's vite/start config and rebuild","Confirm the build produces `dist/server/wrangler.json` + `dist/client` (or `dist/server/index.js`)","If the app is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead","Check the component `path` points at the app directory whose build output SST reads"],"exampleFix":"// before (vite.config.ts)\nplugins: [tanstackStart()]\n// after\nimport { cloudflare } from '@tanstack/cloudflare-vite-plugin';\nplugins: [tanstackStart(), cloudflare()]","handlingStrategy":"validation","validationCode":"import { existsSync } from 'fs';\nconst ok =\n  (existsSync('apps/web/dist/server/wrangler.json') && existsSync('apps/web/dist/client')) ||\n  (existsSync('apps/web/dist/server/index.js') && existsSync('apps/web/dist/client')) ||\n  (existsSync('apps/web/.output/server/index.mjs') && existsSync('apps/web/.output/public'));\nif (!ok) throw new Error('Build TanStack Start with the Cloudflare adapter first');","typeGuard":null,"tryCatchPattern":"try {\n  await deploy();\n} catch (e) {\n  if (/TanStack Start build output not found/.test(e.message)) console.error('Install/configure the Cloudflare deployment adapter and rebuild');\n}","preventionTips":["Configure the TanStack Cloudflare deployment adapter before first deploy","Build the app before `sst deploy`","Confirm expected dist layout after upgrading TanStack Start versions","Use StaticSite for prerender-only apps"],"tags":["tanstack-start","cloudflare","build-output","nitro"],"backgroundTag":"build-output-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}