{"record":{"id":"707731d2bddad0f0","repo":"anomalyco/sst","slug":"cannot-route-the-site-using-the-provided-router-t","errorCode":null,"errorMessage":"Cannot route the site using the provided router. The Router component uses inline routes which has been deprecated.","messagePattern":"Cannot route the site using the provided router\\. The Router component uses inline routes which has been deprecated\\.","errorType":"exception","errorClass":"VisibleError","httpStatus":null,"severity":"error","filePath":"platform/src/components/aws/router.ts","lineNumber":3234,"sourceCode":"  router: Input<Router>;\n  domain?: Input<string>;\n  path?: Input<string>;\n};\n\nexport function normalizeRouteArgs(\n  route?: Input<RouterRouteArgs>,\n  routeDeprecated?: Input<RouterRouteArgsDeprecated>,\n) {\n  if (!route && !routeDeprecated) return undefined;\n\n  return all([route, routeDeprecated]).apply(([route, routeDeprecated]) => {\n    const v = route\n      ? route\n      : { ...routeDeprecated, instance: routeDeprecated!.router };\n\n    return v.instance._hasInlineRoutes.apply((hasInlineRoutes) => {\n      if (hasInlineRoutes)\n        throw new VisibleError(\n          \"Cannot route the site using the provided router. The Router component uses inline routes which has been deprecated.\",\n        );\n\n      const pathPrefix = v.path\n        ? \"/\" + v.path.replace(/^\\//, \"\").replace(/\\/$/, \"\")\n        : undefined;\n      return {\n        hostPattern: v.domain\n          ? v.domain\n              .replace(/[.+?^${}()|[\\]\\\\]/g, \"\\\\$&\") // Escape special regex chars\n              .replace(/\\*/g, \".*\") // Replace * with .*\n          : undefined,\n        pathPrefix,\n        routerDistributionId: v.instance.nodes.cdn.nodes.distribution.id,\n        routerUrl: v.instance.url.apply(\n          (url) =>\n            (v.domain ? `https://${v.domain}` : url) + (pathPrefix ?? \"\"),\n        ),","sourceCodeStart":3216,"sourceCodeEnd":3252,"githubUrl":"https://github.com/anomalyco/sst/blob/a0bd20f762883e72a35caccb4896c42ce5b3f707/platform/src/components/aws/router.ts#L3216-L3252","documentation":"SST's Router component deprecated inline routes (routes defined directly inside the Router's `routes` prop). When another component (e.g. a site or bucket) is routed through a Router whose instance reports `_hasInlineRoutes`, SST refuses to route it, because routing targets now must be standalone Router instances rather than inline route entries.","triggerScenarios":"Passing a `route`/`router` argument that points at a Router created with inline `routes: { ... }` entries, or a deprecated route object (`routeDeprecated`) whose `instance.router` has inline routes configured, when calling routing on a site/bucket component.","commonSituations":"Migrating older SST v1-style configs where domains/routes were declared inline on the Router; copying old examples; upgrading sst and old Router config still present.","solutions":["Move inline routes out of the Router component into separate `sst.aws.Router` instances and route to that instance instead","Remove the deprecated `route` shorthand and pass the Router component instance directly as `router`","Check the Router docs for the current routing API and update the site's `router`/`route` args"],"exampleFix":"// before\nnew sst.aws.Router(\"Web\", { routes: { \"/api\": \"https://api.example.com\" } });\nnew sst.aws.Astro(\"Site\", { route: router });\n// after\nconst apiRouter = new sst.aws.Router(\"Api\", { domain: \"api.example.com\" });\nnew sst.aws.Astro(\"Site\", { router: apiRouter });","handlingStrategy":"validation","validationCode":"// before routing, inspect router config\nconst usesInlineRoutes = \"routes\" in routerArgs && routerArgs.routes;\nif (usesInlineRoutes) throw new Error(\"Move inline routes to separate sst.aws.Router instances before routing a site.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create one sst.aws.Router per route target and pass the instance via `router`","Grep config for `routes:` inside Router components when migrating","Run `sst deploy` on a branch after upgrades to catch deprecation throws early"],"tags":["router","deprecated","configuration"],"backgroundTag":"deprecated-inline-routes","analyzedSha":"a0bd20f762883e72a35caccb4896c42ce5b3f707","analyzedAt":"2026-08-30T11:26:00.383Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}