anomalyco/sst · error · VisibleError
SolidStart's app.config.ts must be configured to use the "aw
Error message
SolidStart's app.config.ts must be configured to use the "aws-lambda" preset. It is currently set to "${nitro.preset}". What it means
SST builds SolidStart apps through Nitro, which must emit an `aws-lambda` preset output so the resulting `.output` can run on Lambda. After the build, SST reads `.output/nitro.json` and rejects any preset other than `aws-lambda`, failing the deployment with a clear message naming the current preset.
Source
Thrown at platform/src/components/aws/solid-start.ts:414
opts: ComponentResourceOptions = {},
) {
super(__pulumiType, name, args, opts);
}
protected normalizeBuildCommand() { }
protected buildPlan(outputPath: Output<string>): Output<Plan> {
return outputPath.apply((outputPath) => {
// Make sure aws-lambda preset is used in nitro.json
const nitro = JSON.parse(
fs.readFileSync(
path.join(outputPath, ".output", "nitro.json"),
"utf-8",
),
);
if (!["aws-lambda"].includes(nitro.preset)) {
throw new VisibleError(
`SolidStart's app.config.ts must be configured to use the "aws-lambda" preset. It is currently set to "${nitro.preset}".`,
);
}
// Get base path
const appConfig = fs.readFileSync(
path.join(outputPath, "app.config.ts"),
"utf-8",
);
const basepath = appConfig.match(/baseURL: ['"](.*)['"]/)?.[1];
// Remove the .output/public/_server directory from the assets
// b/c all `_server` requests should go to the server function. If this folder is
// not removed, it will create an s3 route that conflicts with the `_server` route.
fs.rmSync(path.join(outputPath, ".output", "public", "_server"), {
recursive: true,
force: true,
});View on GitHub (pinned to a0bd20f762)
Solutions
- Set `preset: "aws-lambda"` in the nitro config inside app.config.ts
- Delete any stale `.output` directory and rebuild so nitro.json reflects the new preset
- Re-run `sst deploy`
Example fix
// before (app.config.ts)
export default defineConfig({
vite: {},
nitro: { preset: "node-server" },
});
// after
export default defineConfig({
vite: {},
nitro: { preset: "aws-lambda" },
}); Defensive patterns
Strategy: validation
Validate before calling
import { readFileSync, existsSync } from "fs";
const nitroJson = ".output/nitro.json";
if (existsSync(nitroJson)) {
const preset = JSON.parse(readFileSync(nitroJson, "utf-8")).preset;
if (preset !== "aws-lambda") throw new Error(`Set nitro preset to aws-lambda, got ${preset}`);
} Type guard
function isAwsLambdaPreset(nitro: { preset: string }): nitro is { preset: "aws-lambda" } {
return nitro.preset === "aws-lambda";
} Try / catch
try {
new sst.aws.SolidStart("Web", { path: "src" });
} catch (e) {
console.error("Fix app.config.ts nitro preset to aws-lambda");
throw e;
} Prevention
- Pin `nitro: { preset: "aws-lambda" }` in app.config.ts
- Delete .output before rebuilding after changing presets
- Keep a CI check that greps app.config.ts for the preset
When it happens
Trigger: Running `sst deploy` (or dev/build of a SolidStart site) when the project's `app.config.ts` sets a nitro preset other than `aws-lambda` (e.g. `node-server`, `aws_lambda` mis-spelled, `vercel`).
Common situations: Migrating an existing SolidStart/Nuxt-style app to SST without changing the preset; copying a starter that used `node-server` for local servers; typos in the preset name that Nitro silently falls back from.
Related errors
- No AWS-Lambda preset detected for TanStack Start. Add the n
- No AWS-Lambda preset detected for TanStack Start. Update yo
- SolidStart's nitro.config.ts must be configured to use the "
- SSR server bundle "index.mjs" not found in the build output
- Handler not found: %v
AI-assisted analysis of anomalyco/sst@a0bd20f762 (2026-08-30).
Data as JSON: /api/errors/a7e7ab82d76ffdbb.
Report an issue: GitHub.