angular/angular · error · Error

The provided router is not an Angular Router.

Error message

The provided router is not an Angular Router.

What it means

Error "The provided router is not an Angular Router." thrown in angular/angular.

Source

Thrown at packages/router/src/router_devtools.ts:33

 */
export function getLoadedRoutes(route: Route): Route[] | undefined {
  return route._loadedRoutes;
}

/**
 * Returns the Router instance from the given injector, or null if not available.
 */
export function getRouterInstance(injector: Injector): Router | null {
  return injector.get(Router, null, {optional: true});
}

/**
 * Navigates the given router to the specified URL.
 * Throws if the provided router is not an Angular Router.
 */
export function navigateByUrl(router: Router, url: string): Promise<boolean> {
  if (!(router instanceof Router)) {
    throw new Error('The provided router is not an Angular Router.');
  }
  return router.navigateByUrl(url);
}

View on GitHub (pinned to 51cb07e980)

Solutions

  1. Pass an actual Angular Router instance to the devtools integration, obtained from the injector.

When it happens

Trigger: Thrown at packages/router/src/router_devtools.ts:33 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of angular/angular@51cb07e980 (2026-08-22). Data as JSON: /api/errors/4f139543dfb7cf9b. Report an issue: GitHub.