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
- Set `server: { preset: "aws-lambda" }` in `app.config.ts`, then rebuild and redeploy.
- Optionally add `server: { preset: "aws-lambda", awsLambda: { streaming: true } }` for response streaming.
- Check that no `NITRO_PRESET` env var overrides the config, and confirm `.output/nitro.json` reports `"preset": "aws-lambda"`.
- 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
- Set `server: { preset: "aws-lambda" }` in app.config.ts for any AWS deployment via SST.
- Ensure NITRO_PRESET isn't overriding the preset with another target.
- Verify `.output/nitro.json` shows "preset": "aws-lambda" before deploy.
- Plan a migration to the Vite/Nitro pipeline, since the Vinxi variant of TanStack Start is legacy.
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
- No AWS-Lambda preset detected for TanStack Start. Add the n
- SolidStart's app.config.ts must be configured to use the "aw
- TanStack Start build output not found in "${path.resolve(out
- TanStack Start assets directory not found at: "${path.reso
- You cannot provide both "job" and "function" in the "${name}
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/1491c13a12c026f4.
Report an issue: GitHub.