{"record":{"id":"caf94c6eed866a31","repo":"anomalyco/sst","slug":"tanstack-start-assets-directory-not-found-at","errorCode":null,"errorMessage":"TanStack Start assets directory not found at:\n  \"${assetsPath}\".","messagePattern":"TanStack Start assets directory not found at:\n  \"(.+?)\"\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/cloudflare/tan-stack-start.ts","lineNumber":327,"sourceCode":"              `TanStack Start build output at \"${path.resolve(wranglerPath)}\" is missing the Worker entry in \\`main\\`.`,\n            );\n          }\n\n          const serverPath = path.resolve(outputPath, \"dist\", \"server\", wrangler.main);\n          const assetsPath = path.resolve(\n            outputPath,\n            \"dist\",\n            \"server\",\n            wrangler.assets?.directory ?? \"../client\",\n          );\n\n          if (!(await existsAsync(serverPath))) {\n            throw new VisibleError(\n              `TanStack Start server bundle not found at:\\n  \"${serverPath}\".`,\n            );\n          }\n          if (!(await existsAsync(assetsPath))) {\n            throw new VisibleError(\n              `TanStack Start assets directory not found at:\\n  \"${assetsPath}\".`,\n            );\n          }\n\n          return {\n            server: toPlanPath(serverPath),\n            assets: toPlanPath(assetsPath),\n          };\n        }\n\n        for (const serverFile of [\"index.js\", \"index.mjs\"]) {\n          const serverPath = path.join(\n            outputPath,\n            \"dist\",\n            \"server\",\n            serverFile,\n          );\n          const assetsPath = path.join(outputPath, \"dist\", \"client\");","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/cloudflare/tan-stack-start.ts#L309-L345","documentation":"After validating the server bundle, SST checks the client assets directory referenced by wrangler.json (`assets.directory`, defaulting to `../client`, resolved to `dist/client`). If that directory is missing, SST cannot wire static assets and throws a VisibleError.","triggerScenarios":"A TanStack Start dist build where `dist/server` exists but `dist/client` (or the configured `assets.directory`) does not: client build step skipped/failed, custom assets.directory pointing at a non-existent folder.","commonSituations":"Running only the server-side part of a multi-step build; CI caching restored only server output; edited wrangler.json assets.directory to a wrong path.","solutions":["Run the full build so `dist/client` is emitted","Verify/fix `assets.directory` in dist/server/wrangler.json (best via the adapter, not hand edits)","Clean dist and rebuild if the output is partially stale"],"exampleFix":"// before: dist/server exists, dist/client missing (client build failed)\nrm -rf dist && build full project\n// after: dist/client and dist/server both present, sst deploy succeeds","handlingStrategy":"validation","validationCode":"import { readFileSync, existsSync } from 'fs';\nconst w = JSON.parse(readFileSync('apps/web/dist/server/wrangler.json', 'utf8'));\nconst assets = `apps/web/dist/server/${w.assets?.directory ?? '../client'}`;\nif (!existsSync(assets)) throw new Error(`Client assets missing at ${assets}; run the full build`);","typeGuard":null,"tryCatchPattern":"try {\n  await deploy();\n} catch (e) {\n  if (/assets directory not found/.test(e.message)) console.error('dist/client missing; run the full client build');\n}","preventionTips":["Run both client and server build steps in CI","Check cached CI artifacts include dist/client","Keep assets.directory at its default unless intentionally configured","Fail CI early if dist/client is absent"],"tags":["tanstack-start","cloudflare","build-output","assets"],"backgroundTag":"build-output-not-found","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}