{"record":{"id":"57059d6c999070dc","repo":"ionic-team/ionic-framework","slug":"could-not-find-activated-route-proxy-for-view","errorCode":null,"errorMessage":"Could not find activated route proxy for view","messagePattern":"Could not find activated route proxy for view","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/angular/common/src/directives/navigation/router-outlet.ts","lineNumber":434,"sourceCode":"      // First wait until the component instance is pushed\n      filter((component) => !!component),\n      switchMap((component) =>\n        this.currentActivatedRoute$.pipe(\n          filter((current) => current !== null && current.component === component),\n          switchMap((current) => current && (current.activatedRoute as any)[path]),\n          distinctUntilChanged()\n        )\n      )\n    );\n  }\n\n  /**\n   * Updates the activated route proxy for the given component to the new incoming router state\n   */\n  private updateActivatedRouteProxy(component: any, activatedRoute: ActivatedRoute): void {\n    const proxy = this.proxyMap.get(component);\n    if (!proxy) {\n      throw new Error(`Could not find activated route proxy for view`);\n    }\n\n    (proxy as any)._futureSnapshot = (activatedRoute as any)._futureSnapshot;\n    (proxy as any)._routerState = (activatedRoute as any)._routerState;\n    proxy.snapshot = activatedRoute.snapshot;\n    proxy.outlet = activatedRoute.outlet;\n    proxy.component = activatedRoute.component;\n\n    this.currentActivatedRoute$.next({ component, activatedRoute });\n  }\n}\n\nclass OutletInjector implements Injector {\n  constructor(private route: ActivatedRoute, private childContexts: ChildrenOutletContexts, private parent: Injector) {}\n\n  get(token: any, notFoundValue?: any): any {\n    if (token === ActivatedRoute) {\n      return this.route;","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/ionic-team/ionic-framework/blob/625f9c38ad8c5db8a6c12df5c1622a36da90f9e3/packages/angular/common/src/directives/navigation/router-outlet.ts#L416-L452","documentation":"Thrown by IonRouterOutlet.updateActivatedRouteProxy() when a component instance is not found in proxyMap. Ionic stores a per-component ActivatedRoute proxy when a view is first created so it can keep route data in sync as the user navigates back to cached pages. If updateActivatedRouteProxy is called for a component that was never registered (or whose WeakMap entry was collected), it throws. This is primarily an internal-consistency error signaling a corrupted or unexpected view lifecycle.","triggerScenarios":"The stack controller hands back an existing view (getExistingView) whose component instance has no proxy entry - e.g. because it was created by an older code path, a different Ionic Angular version, manual DOM/component creation, or a state-restore that bypassed createView's proxy registration.","commonSituations":"Version mismatch between @ionic/angular and @ionic/core; SSR hydration reusing component instances that had no proxy; tabs/nested outlets restoring a view from a serialized state; hot-module reload reusing stale component instances; manual manipulation of the outlet's stack.","solutions":["Ensure @ionic/angular, @ionic/core and @angular/router versions are mutually compatible (check the Ionic release notes / peer-deps).","Avoid manually caching or reinserting component instances into an ion-router-outlet's stack; let the outlet create and manage them.","If using SSR, disable or correctly hydrate the router-outlet so proxies are recreated."],"exampleFix":"// No safe userland code change; this is an internal invariant.\n// Fix is environmental/version alignment:\n// package.json\n\"@ionic/angular\": \"^8.x\",\n\"@ionic/core\": \"^8.x\",\n\"@angular/router\": \"^19.x\"  // match the version Ionic 8 supports","handlingStrategy":"try-catch","validationCode":"// Internal invariant - the best prevention is version alignment.\n// Verify peer deps before building:\n// @ionic/angular and @ionic/core must share a major version, and\n// @angular/router must match what that Ionic release supports.","typeGuard":null,"tryCatchPattern":"try {\n  outlet.someStackOperation();\n} catch (e) {\n  if (e instanceof Error && /activated route proxy/i.test(e.message)) {\n    // force a clean re-creation of the view: navigate with replaceUrl\n    router.navigate([url], { replaceUrl: true });\n  } else { throw e; }\n}","preventionTips":["Align @ionic/angular, @ionic/core, and @angular/router versions.","Do not manually insert/cached component instances into the outlet stack.","In SSR, fully hydrate/recreate router-outlet proxies rather than reusing instances."],"tags":["angular","router","router-outlet","internal","version-compat","runtime"],"backgroundTag":null,"analyzedSha":"625f9c38ad8c5db8a6c12df5c1622a36da90f9e3","analyzedAt":"2026-08-12T16:00:25.413Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}