Skip to content

fix(vue): handle page lifecycle errors - #31634

Open
Marve10s wants to merge 1 commit into
ionic-team:mainfrom
Marve10s:fix/vue-lifecycle-error-handling
Open

Marve10s wants to merge 1 commit into
ionic-team:mainfrom
Marve10s:fix/vue-lifecycle-error-handling

Conversation

@Marve10s

Copy link
Copy Markdown

Issue number: resolves #30374

What is the current behavior?

Ionic page lifecycle hooks bypass Vue's error handling. Rejected promises do not reach onErrorCaptured or app.config.errorHandler, and synchronous throws can interrupt the page transition and leave the page invisible.

What is the new behavior?

Composition API hooks, component options, and instance methods invoke callbacks through Vue's callWithAsyncErrorHandling, using the owning component instance. Errors follow Vue's normal capture and propagation rules. A handled failure allows navigation to complete, while callback receivers, arguments, and return values are preserved.

The existing Vue test app includes a reproduction at /lifecycle-errors?api=composition&async=false. It also accepts api=options and async=true to exercise all four combinations.

Does this introduce a breaking change?

  • Yes
  • No

Other information

All 52 new regression cases fail against the original bundle and pass with this change. The full Vue unit suite passes all 125 tests. Package lint, typecheck, build, and the reproduction app build pass. The tests use real Vue components, Ionic router, and outlet in jsdom; browser e2e tests were not run locally.

The error diagnostic uses Vue's existing transition hook category. Unhandled errors continue to follow Vue's normal policy.

@Marve10s
Marve10s requested a review from a team as a code owner October 22, 2026 18:29
@Marve10s
Marve10s requested a review from ShaneK October 22, 2026 18:29
@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Marve10s is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the package: vue @ionic/vue package label Oct 22, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: vue @ionic/vue package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ionic Framework Lifecycle should wrap with vue ErrorHandler

1 participant