emberjs/ember.js · info · Error

TRANSITION_ABORTED

TRANSITION_ABORTED

Error message

TransitionAborted

What it means

buildTransitionAborted creates the sentinel TransitionAbortedError (name 'TransitionAborted', code 'TRANSITION_ABORTED') thrown when a transition is aborted — typically by a redirect in a route hook (transitionTo/intermediateTransitionTo) or transition.abort(). Callers detect it via error.name/code to distinguish normal aborts from real failures.

Source

Thrown at packages/router_js/lib/transition-aborted-error.ts:3

export interface TransitionAbortedError extends Error {
  name: 'TransitionAborted';
  code: 'TRANSITION_ABORTED';
}

export function buildTransitionAborted() {
  let error = new Error('TransitionAborted') as TransitionAbortedError;
  error.name = 'TransitionAborted';
  error.code = 'TRANSITION_ABORTED';
  return error;
}

export function isTransitionAborted(maybeError: unknown): maybeError is TransitionAbortedError {
  return (
    typeof maybeError === 'object' &&
    maybeError !== null &&
    (maybeError as TransitionAbortedError).code === 'TRANSITION_ABORTED'
  );
}

interface Abortable<T extends boolean> {

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Check error.name === 'TransitionAborted' (or code 'TRANSITION_ABORTED') and ignore/handle it separately from real errors.
  2. Let redirects happen via returning the new transition or transitionTo from hooks rather than mixing with promises in ways that race.
  3. Avoid starting multiple overlapping transitions; guard with a check like router.currentRouteName.
  4. In .catch handlers, filter the sentinel before reporting errors.

Example fix

// before
this.router.transitionTo('login').catch(e => report(e));
// after
this.router.transitionTo('login').catch(e => {
  if (e && e.name === 'TransitionAborted') return;
  report(e);
});
Defensive patterns

Strategy: try-catch

Validate before calling

// Avoid racing transitions: skip if one is already underway to the same place
if (router.currentRouteName === targetName) return;
return router.transitionTo(targetName);

Type guard

function isTransitionAborted(e) { return !!e && e.name === 'TransitionAborted' && e.code === 'TRANSITION_ABORTED'; }

Try / catch

transition.catch(e => {
  if (isTransitionAborted(e)) return; // expected on redirects
  handleError(e);
});

Prevention

When it happens

Trigger: A route hook calls this.transitionTo (redirect), causing the original transition to be aborted; transition.abort() invoked; router internally aborts superseded transitions when a new one starts.

Common situations: Redirecting in beforeModel based on auth (throwing abort implicitly); double transitions racing (a new transition supersedes the running one); aborting in willTransition; test code not expecting the abort sentinel.

Related errors


AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01). Data as JSON: /api/errors/a3c6b5b68e998e8f. Report an issue: GitHub.