angular/angular · error · RuntimeError

NULLISH_COMMAND

NULLISH_COMMAND

Error message

The requested path contains ${cmd} segment at index ${i}

What it means

Error "The requested path contains ${cmd} segment at index ${i}" thrown in angular/angular.

Source

Thrown at packages/router/src/router.ts:717

      resolve: resolve!,
      reject: reject!,
      promise,
      currentSnapshot: this.routerState.snapshot,
      currentRouterState: this.routerState,
    });

    // Make sure that the error is propagated even though `processNavigations` catch
    // handler does not rethrow
    // perf: Use `.bind` to avoid holding the other closures in this scope while this promise is unsettled.
    return promise.catch(Promise.reject.bind(Promise));
  }
}

function validateCommands(commands: readonly string[]): void {
  for (let i = 0; i < commands.length; i++) {
    const cmd = commands[i];
    if (cmd == null) {
      throw new RuntimeError(
        RuntimeErrorCode.NULLISH_COMMAND,
        (typeof ngDevMode === 'undefined' || ngDevMode) &&
          `The requested path contains ${cmd} segment at index ${i}`,
      );
    }
  }
}

View on GitHub (pinned to 51cb07e980)

Solutions

  1. The URL contains a segment that is a router command (e.g. an outlets expression) in an invalid position; fix the routerLink commands array.

When it happens

Trigger: Thrown at packages/router/src/router.ts:717 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/26d0ae613afda3cf. Report an issue: GitHub.