anomalyco/sst · error · VisibleError

TanStack Start build output not found in "${path.resolve(out

Error message

TanStack Start build output not found in "${path.resolve(outputPath)}".

Expected one of:
  - dist/server/wrangler.json and dist/client
  - dist/server/index.js and dist/client
  - .output/server/index.mjs and .output/public

Use the Cloudflare deployment adapter in TanStack Start, or if your project is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead.

What it means

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.

Source

Thrown at platform/src/components/cloudflare/tan-stack-start.ts:280

  protected validate(sitePath: string): void {
    validateFrameworkConfig({
      sitePath,
      configName: "vite.config",
      componentName: "TanStackStart",
    });
    validateNoWranglerFile(sitePath, "TanStackStart");
  }

  protected buildPlan(outputPath: Output<string>): Output<Plan> {
    return outputPath.apply(async (outputPath) => {
      const distPlan = await resolveDistPlan();
      if (distPlan) return distPlan;

      const legacyPlan = await resolveLegacyPlan();
      if (legacyPlan) return legacyPlan;

      throw new VisibleError(
        [
          `TanStack Start build output not found in "${path.resolve(outputPath)}".`,
          "",
          "Expected one of:",
          "  - dist/server/wrangler.json and dist/client",
          "  - dist/server/index.js and dist/client",
          "  - .output/server/index.mjs and .output/public",
          "",
          "Use the Cloudflare deployment adapter in TanStack Start, or if your project is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead.",
        ].join("\n"),
      );

      async function resolveDistPlan() {
        const wranglerPath = path.join(
          outputPath,
          "dist",
          "server",
          "wrangler.json",

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Configure the Cloudflare deployment adapter (`@tanstack/cloudflare`) in the project's vite/start config and rebuild
  2. Confirm the build produces `dist/server/wrangler.json` + `dist/client` (or `dist/server/index.js`)
  3. If the app is entirely pre-rendered, use `sst.cloudflare.StaticSite` instead
  4. Check the component `path` points at the app directory whose build output SST reads

Example fix

// before (vite.config.ts)
plugins: [tanstackStart()]
// after
import { cloudflare } from '@tanstack/cloudflare-vite-plugin';
plugins: [tanstackStart(), cloudflare()]
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'fs';
const ok =
  (existsSync('apps/web/dist/server/wrangler.json') && existsSync('apps/web/dist/client')) ||
  (existsSync('apps/web/dist/server/index.js') && existsSync('apps/web/dist/client')) ||
  (existsSync('apps/web/.output/server/index.mjs') && existsSync('apps/web/.output/public'));
if (!ok) throw new Error('Build TanStack Start with the Cloudflare adapter first');

Try / catch

try {
  await deploy();
} catch (e) {
  if (/TanStack Start build output not found/.test(e.message)) console.error('Install/configure the Cloudflare deployment adapter and rebuild');
}

Prevention

When it happens

Trigger: `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.

Common situations: 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.

Related errors


AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30). Data as JSON: /api/errors/5516d803e02da373. Report an issue: GitHub.