ionic-team/ionic-framework · error · Error

Could not find activated route proxy for view

Error message

Could not find activated route proxy for view

What it means

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.

Source

Thrown at packages/angular/common/src/directives/navigation/router-outlet.ts:434

      // First wait until the component instance is pushed
      filter((component) => !!component),
      switchMap((component) =>
        this.currentActivatedRoute$.pipe(
          filter((current) => current !== null && current.component === component),
          switchMap((current) => current && (current.activatedRoute as any)[path]),
          distinctUntilChanged()
        )
      )
    );
  }

  /**
   * Updates the activated route proxy for the given component to the new incoming router state
   */
  private updateActivatedRouteProxy(component: any, activatedRoute: ActivatedRoute): void {
    const proxy = this.proxyMap.get(component);
    if (!proxy) {
      throw new Error(`Could not find activated route proxy for view`);
    }

    (proxy as any)._futureSnapshot = (activatedRoute as any)._futureSnapshot;
    (proxy as any)._routerState = (activatedRoute as any)._routerState;
    proxy.snapshot = activatedRoute.snapshot;
    proxy.outlet = activatedRoute.outlet;
    proxy.component = activatedRoute.component;

    this.currentActivatedRoute$.next({ component, activatedRoute });
  }
}

class OutletInjector implements Injector {
  constructor(private route: ActivatedRoute, private childContexts: ChildrenOutletContexts, private parent: Injector) {}

  get(token: any, notFoundValue?: any): any {
    if (token === ActivatedRoute) {
      return this.route;

View on GitHub (pinned to 625f9c38ad)

Solutions

  1. Ensure @ionic/angular, @ionic/core and @angular/router versions are mutually compatible (check the Ionic release notes / peer-deps).
  2. Avoid manually caching or reinserting component instances into an ion-router-outlet's stack; let the outlet create and manage them.
  3. If using SSR, disable or correctly hydrate the router-outlet so proxies are recreated.

Example fix

// No safe userland code change; this is an internal invariant.
// Fix is environmental/version alignment:
// package.json
"@ionic/angular": "^8.x",
"@ionic/core": "^8.x",
"@angular/router": "^19.x"  // match the version Ionic 8 supports
Defensive patterns

Strategy: try-catch

Validate before calling

// Internal invariant - the best prevention is version alignment.
// Verify peer deps before building:
// @ionic/angular and @ionic/core must share a major version, and
// @angular/router must match what that Ionic release supports.

Try / catch

try {
  outlet.someStackOperation();
} catch (e) {
  if (e instanceof Error && /activated route proxy/i.test(e.message)) {
    // force a clean re-creation of the view: navigate with replaceUrl
    router.navigate([url], { replaceUrl: true });
  } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of ionic-team/ionic-framework@625f9c38ad (2026-08-12). Data as JSON: /api/errors/57059d6c999070dc. Report an issue: GitHub.