{"record":{"id":"264f367ad138dce9","repo":"anomalyco/sst","slug":"lambda-edge-runtime-is-deprecated-update-your-ope","errorCode":null,"errorMessage":"Lambda@Edge runtime is deprecated. Update your OpenNext configuration to use the standard Lambda runtime and deploy to multiple regions using the \"regions\" option in your Nextjs component.","messagePattern":"Lambda@Edge runtime is deprecated\\. Update your OpenNext configuration to use the standard Lambda runtime and deploy to multiple regions using the \"regions\" option in your Nextjs component\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/nextjs.ts","lineNumber":624,"sourceCode":"      },\n    );\n  }\n\n  protected buildPlan(\n    outputPath: Output<string>,\n    name: string,\n    args: NextjsArgs,\n    { bucket }: { bucket: Bucket },\n  ): Output<Plan> {\n    const parent = this;\n\n    const ret = all([outputPath, args?.imageOptimization]).apply(\n      ([outputPath, imageOptimization]) => {\n        const { openNextOutput, buildId, prerenderManifest, base } =\n          loadBuildOutput();\n\n        if (Object.entries(openNextOutput.edgeFunctions).length) {\n          throw new VisibleError(\n            `Lambda@Edge runtime is deprecated. Update your OpenNext configuration to use the standard Lambda runtime and deploy to multiple regions using the \"regions\" option in your Nextjs component.`,\n          );\n        }\n\n        const { revalidationQueue, revalidationFunction } =\n          createRevalidationQueue();\n        const revalidationTable = createRevalidationTable();\n        createRevalidationTableSeeder();\n\n        const serverOrigin = openNextOutput.origins[\"default\"];\n        const imageOptimizerOrigin = openNextOutput.origins[\"imageOptimizer\"];\n        const s3Origin = openNextOutput.origins[\"s3\"];\n        const plan = all([\n          revalidationTable?.arn,\n          revalidationTable?.name,\n          bucket.arn,\n          bucket.name,\n          getRegionOutput(undefined, { parent: bucket }).region,","sourceCodeStart":606,"sourceCodeEnd":642,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/nextjs.ts#L606-L642","documentation":"During Nextjs build-plan generation, SST inspects the OpenNext output for edge functions. Deploying Next.js middleware or routes to Lambda@Edge is deprecated in SST, so any edgeFunctions entries cause this VisibleError directing you to the standard Lambda runtime plus the regions option.","triggerScenarios":"Building a Nextjs component whose OpenNext build output (.open-next/open-next.output.json) contains one or more edgeFunctions, e.g. middleware configured with `runtime: \"edge\"` or edge runtime route handlers.","commonSituations":"Older Next.js apps using `export const runtime = \"edge\"` for middleware; OpenNext configs that still target Lambda@Edge; following outdated deployment guides.","solutions":["Remove edge runtime usage (e.g. middleware `runtime: \"edge\"`) so OpenNext builds standard Lambda functions","Use the `regions` option on the sst.aws.Nextjs component to deploy to multiple regions instead of Lambda@Edge","Regenerate the app with `opennextjs build` and verify .open-next output has no edgeFunctions, then re-deploy"],"exampleFix":"// before\n// middleware.ts\nexport const config = { runtime: \"edge\" };\n// after\n// middleware.ts (no edge runtime)\nexport const config = { matcher: \"/about/:path*\" };\n// and in sst.config.ts\nnew sst.aws.Nextjs(\"Web\", { regions: [\"us-east-1\", \"eu-west-1\"] });","handlingStrategy":"validation","validationCode":"// After building with OpenNext, before deploying\nconst out = JSON.parse(fs.readFileSync(\".open-next/open-next.output.json\"));\nif (Object.keys(out.edgeFunctions ?? {}).length > 0) {\n  throw new Error(\"Edge functions detected: migrate off Lambda@Edge\");\n}","typeGuard":"function hasEdgeFunctions(out: OpenNextOutput): boolean {\n  return Object.keys(out.edgeFunctions ?? {}).length > 0;\n}","tryCatchPattern":null,"preventionTips":["Remove `runtime: \"edge\"` from middleware and route handlers","Use the Nextjs `regions` option for multi-region instead of Lambda@Edge","Keep OpenNext config and SST component versions aligned with current docs","Inspect .open-next/open-next.output.json in CI to catch edgeFunctions early"],"tags":["nextjs","opennext","lambda-edge","deprecation"],"backgroundTag":"deprecated-runtime-migration","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}