anomalyco/sst · error · VisibleError

No AWS-Lambda preset detected for TanStack Start. Update yo

Error message

No AWS-Lambda preset detected for TanStack Start.

Update your `app.config.ts`:
  // app.config.ts
  export default defineConfig({
    server: {
      preset: "aws-lambda",

What it means

Same condition as error 183 — the Nitro build of a TanStack Start app does not use the `aws-lambda` preset — but this variant is thrown for older Vinxi-based projects: no `vite.config.ts`/`vite.config.js` was found at the project root, so `buildPlan` (platform/src/components/aws/tan-stack-start.ts:397) raises the error pointing at `app.config.ts` where the Vinxi-era Nitro `server` config lives.

Source

Thrown at platform/src/components/aws/tan-stack-start.ts:397

              "Add the nitro preset to your `vite.config.ts`:",
              "  // vite.config.ts",
              '  import { nitro } from "nitro/vite"',
              "",
              "  export default defineConfig({",
              "    plugins: [nitro(), tanstackStart(), ...],",
              "    nitro: {",
              '      preset: "aws-lambda",',
              "      awsLambda: { streaming: true }, // optional",
              "    },",
              "  });",
              "",
              `Detected preset: "${nitro.preset ?? "undefined"}"`,
            ].join("\n"),
          );
        }

        // Vinxi project
        throw new VisibleError(
          [
            "No AWS-Lambda preset detected for TanStack Start.",
            "",
            "Update your `app.config.ts`:",
            "  // app.config.ts",
            "  export default defineConfig({",
            "    server: {",
            '      preset: "aws-lambda",',
            "      awsLambda: { streaming: true }, // optional",
            "    },",
            "  });",
            "",
            `Detected preset: "${nitro.preset ?? "undefined"}"`,
          ].join("\n"),
        );
      }

      const serverOutputPath = path.resolve(outputPath, ".output", "server");

View on GitHub (pinned to a0bd20f762)

Solutions

  1. Set `server: { preset: "aws-lambda" }` in `app.config.ts`, then rebuild and redeploy.
  2. Optionally add `server: { preset: "aws-lambda", awsLambda: { streaming: true } }` for response streaming.
  3. Check that no `NITRO_PRESET` env var overrides the config, and confirm `.output/nitro.json` reports `"preset": "aws-lambda"`.
  4. Consider migrating the project to the Vite/Nitro pipeline, where the preset moves to `vite.config.ts` (see the Vite variant of this error).

Example fix

// before (app.config.ts)
import { defineConfig } from "@tanstack/start/config";
export default defineConfig({});

// after
import { defineConfig } from "@tanstack/start/config";
export default defineConfig({
  server: {
    preset: "aws-lambda",
    awsLambda: { streaming: true }, // optional
  },
});
Defensive patterns

Strategy: validation

Validate before calling

import fs from "node:fs";
const nitro = JSON.parse(fs.readFileSync(".output/nitro.json", "utf-8"));
if (nitro.preset !== "aws-lambda")
  throw new Error(`Set server.preset to "aws-lambda" in app.config.ts (got: ${nitro.preset ?? "undefined"})`);

Type guard

null

Try / catch

// VisibleError fails the SST deploy; validate the built output before deploying:
const nitro = JSON.parse(require("fs").readFileSync(".output/nitro.json", "utf-8"));
if (nitro.preset !== "aws-lambda") {
  console.error('Set server: { preset: "aws-lambda" } in app.config.ts');
  process.exit(1);
}

Prevention

When it happens

Trigger: Running `sst deploy` for a Vinxi-based TanStack Start app whose `app.config.ts` omits `server.preset` or sets it to a non-AWS value, so `.output/nitro.json` contains a preset other than `aws-lambda`.

Common situations: Older TanStack Start templates created before the Vite migration; presets set for Netlify/Vercel/Node while deploying to AWS via SST; a preset passed via environment variable (`NITRO_PRESET`) overriding or missing from `app.config.ts`.

Related errors


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