{"record":{"id":"1491c13a12c026f4","repo":"anomalyco/sst","slug":"no-aws-lambda-preset-detected-for-tanstack-start-1491c1","errorCode":null,"errorMessage":"No AWS-Lambda preset detected for TanStack Start.\n\nUpdate your `app.config.ts`:\n  // app.config.ts\n  export default defineConfig({\n    server: {\n      preset: \"aws-lambda\",\n","messagePattern":"No AWS-Lambda preset detected for TanStack Start\\.\n\nUpdate your `app\\.config\\.ts`:\n  // app\\.config\\.ts\n  export default defineConfig\\(\\{\n    server: \\{\n      preset: \"aws-lambda\",\n","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/tan-stack-start.ts","lineNumber":397,"sourceCode":"              \"Add the nitro preset to your `vite.config.ts`:\",\n              \"  // vite.config.ts\",\n              '  import { nitro } from \"nitro/vite\"',\n              \"\",\n              \"  export default defineConfig({\",\n              \"    plugins: [nitro(), tanstackStart(), ...],\",\n              \"    nitro: {\",\n              '      preset: \"aws-lambda\",',\n              \"      awsLambda: { streaming: true }, // optional\",\n              \"    },\",\n              \"  });\",\n              \"\",\n              `Detected preset: \"${nitro.preset ?? \"undefined\"}\"`,\n            ].join(\"\\n\"),\n          );\n        }\n\n        // Vinxi project\n        throw new VisibleError(\n          [\n            \"No AWS-Lambda preset detected for TanStack Start.\",\n            \"\",\n            \"Update your `app.config.ts`:\",\n            \"  // app.config.ts\",\n            \"  export default defineConfig({\",\n            \"    server: {\",\n            '      preset: \"aws-lambda\",',\n            \"      awsLambda: { streaming: true }, // optional\",\n            \"    },\",\n            \"  });\",\n            \"\",\n            `Detected preset: \"${nitro.preset ?? \"undefined\"}\"`,\n          ].join(\"\\n\"),\n        );\n      }\n\n      const serverOutputPath = path.resolve(outputPath, \".output\", \"server\");","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/tan-stack-start.ts#L379-L415","documentation":"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.","triggerScenarios":"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`.","commonSituations":"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`.","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)."],"exampleFix":"// before (app.config.ts)\nimport { defineConfig } from \"@tanstack/start/config\";\nexport default defineConfig({});\n\n// after\nimport { defineConfig } from \"@tanstack/start/config\";\nexport default defineConfig({\n  server: {\n    preset: \"aws-lambda\",\n    awsLambda: { streaming: true }, // optional\n  },\n});","handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\nconst nitro = JSON.parse(fs.readFileSync(\".output/nitro.json\", \"utf-8\"));\nif (nitro.preset !== \"aws-lambda\")\n  throw new Error(`Set server.preset to \"aws-lambda\" in app.config.ts (got: ${nitro.preset ?? \"undefined\"})`);","typeGuard":"null","tryCatchPattern":"// VisibleError fails the SST deploy; validate the built output before deploying:\nconst nitro = JSON.parse(require(\"fs\").readFileSync(\".output/nitro.json\", \"utf-8\"));\nif (nitro.preset !== \"aws-lambda\") {\n  console.error('Set server: { preset: \"aws-lambda\" } in app.config.ts');\n  process.exit(1);\n}","preventionTips":["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."],"tags":["tanstack-start","nitro","vinxi","deployment","config"],"backgroundTag":"missing-nitro-preset","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}