anomalyco/sst · error · VisibleError
TanStack Start assets directory not found at: "${assetsPat
Error message
TanStack Start assets directory not found at:
"${assetsPath}". What it means
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.
Source
Thrown at platform/src/components/cloudflare/tan-stack-start.ts:327
`TanStack Start build output at "${path.resolve(wranglerPath)}" is missing the Worker entry in \`main\`.`,
);
}
const serverPath = path.resolve(outputPath, "dist", "server", wrangler.main);
const assetsPath = path.resolve(
outputPath,
"dist",
"server",
wrangler.assets?.directory ?? "../client",
);
if (!(await existsAsync(serverPath))) {
throw new VisibleError(
`TanStack Start server bundle not found at:\n "${serverPath}".`,
);
}
if (!(await existsAsync(assetsPath))) {
throw new VisibleError(
`TanStack Start assets directory not found at:\n "${assetsPath}".`,
);
}
return {
server: toPlanPath(serverPath),
assets: toPlanPath(assetsPath),
};
}
for (const serverFile of ["index.js", "index.mjs"]) {
const serverPath = path.join(
outputPath,
"dist",
"server",
serverFile,
);
const assetsPath = path.join(outputPath, "dist", "client");View on GitHub (pinned to a0bd20f762)
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
Example fix
// before: dist/server exists, dist/client missing (client build failed) rm -rf dist && build full project // after: dist/client and dist/server both present, sst deploy succeeds
Defensive patterns
Strategy: validation
Validate before calling
import { readFileSync, existsSync } from 'fs';
const w = JSON.parse(readFileSync('apps/web/dist/server/wrangler.json', 'utf8'));
const assets = `apps/web/dist/server/${w.assets?.directory ?? '../client'}`;
if (!existsSync(assets)) throw new Error(`Client assets missing at ${assets}; run the full build`); Try / catch
try {
await deploy();
} catch (e) {
if (/assets directory not found/.test(e.message)) console.error('dist/client missing; run the full client build');
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- TanStack Start assets directory not found at: "${path.reso
- React Router assets directory not found at: "${assetsPath}
- TanStack Start build output not found in "${path.resolve(out
- TanStack Start build output at "${path.resolve(wranglerPath)
- TanStack Start server bundle not found at: "${serverPath}"
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/caf94c6eed866a31.
Report an issue: GitHub.