diff --git a/packages/angular/common/src/directives/navigation/stack-controller.ts b/packages/angular/common/src/directives/navigation/stack-controller.ts index 0593219d3f4..e5f89896fd4 100644 --- a/packages/angular/common/src/directives/navigation/stack-controller.ts +++ b/packages/angular/common/src/directives/navigation/stack-controller.ts @@ -275,7 +275,10 @@ export class StackController { enteringEl.classList.add('ion-page'); enteringEl.classList.add('ion-page-invisible'); - if ((containerEl as any).commit) { + // containerEl is set to undefined when the stack controller is destroyed, + // so a transition that resolves after its outlet was destroyed must not + // dereference it (see destroy()). + if ((containerEl as any)?.commit) { return containerEl.commit(enteringEl, leavingEl, { duration: direction === undefined ? 0 : undefined, direction,