{"record":{"id":"b53ef4dee057fa66","repo":"anomalyco/sst","slug":"cannot-provide-both-edge-and-route-use-the-e","errorCode":null,"errorMessage":"Cannot provide both \"edge\" and \"route\". Use the \"edge\" prop on the \"Router\" component when serving your site through a Router.","messagePattern":"Cannot provide both \"edge\" and \"route\"\\. Use the \"edge\" prop on the \"Router\" component when serving your site through a Router\\.","errorType":"validation","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/ssr-site.ts","lineNumber":1264,"sourceCode":"            throw new VisibleError(\n              `Invalid AWS region: \"${region}\". Please specify a valid AWS region.`,\n            );\n          return region as Region;\n        });\n      });\n    }\n\n    function normalizeRoute() {\n      const route = normalizeRouteArgs(args.router, args.route);\n\n      if (route) {\n        if (args.domain)\n          throw new VisibleError(\n            `Cannot provide both \"domain\" and \"route\". Use the \"domain\" prop on the \"Router\" component when serving your site through a Router.`,\n          );\n\n        if (args.edge)\n          throw new VisibleError(\n            `Cannot provide both \"edge\" and \"route\". Use the \"edge\" prop on the \"Router\" component when serving your site through a Router.`,\n          );\n\n        if (args.protection)\n          throw new VisibleError(\n            `Cannot set \"protection\" when routing through a Router. Set \"protection\" on the Router component instead.`,\n          );\n      }\n\n      return route;\n    }\n\n    function normalizeEdge() {\n      return output([args.edge, args.server?.edge]).apply(\n        ([edge, serverEdge]) => {\n          if (serverEdge)\n            throw new VisibleError(\n              `The \"server.edge\" prop is deprecated. Use the \"edge\" prop on the top level instead.`,","sourceCodeStart":1246,"sourceCodeEnd":1282,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/ssr-site.ts#L1246-L1282","documentation":"Edge-function configuration (`edge` prop, for Lambda@Edge SSR) is incompatible with serving the site through a Router. If both `edge` and `route` are set, `normalizeRoute` throws to force you to configure edge behavior on the Router instead.","triggerScenarios":"An SSR site component args include both `edge: true` (or an edge config object) and `route: { router }`.","commonSituations":"Migrating a site that previously used Lambda@Edge to router-based serving; enabling `edge` per old guides while the project also uses a Router for path-based routing.","solutions":["Remove the `edge` prop from the site component args","If edge is required, drop the `route` prop and configure the site standalone (with domain/protection)","If Router-based serving is required, manage any edge settings on the Router component"],"exampleFix":"// before\nnew sst.aws.NextjsSite(\"Web\", {\n  path: \"src\",\n  edge: true,\n  route: { router },\n});\n// after\nnew sst.aws.NextjsSite(\"Web\", {\n  path: \"src\",\n  route: { router },\n});","handlingStrategy":"validation","validationCode":"if (siteArgs.edge && siteArgs.route) {\n  throw new Error('Remove `edge` when using `route`; configure edge on the Router if needed');\n}","typeGuard":null,"tryCatchPattern":"try {\n  new sst.aws.NextjsSite(\"Web\", args);\n} catch (e) {\n  if (String(e).includes('Cannot provide both \"edge\" and \"route\"')) console.error(\"Drop `edge` or drop `route`\");\n  throw e;\n}","preventionTips":["Treat `edge` and `route` as mutually exclusive in your config helpers","Document the serving model (edge vs router) for the team","Validate site args in a shared factory function before constructing components"],"tags":["ssr-site","router","edge","config-conflict"],"backgroundTag":"conflicting-props","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}