mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
fix(router): handle errors from view transition updateCallbackDone promise
Firefox-specific workaround: Firefox 144+ creates the `updateCallbackDone` promise internally during error handling (e.g., duplicate view-transition-name), even before the property is accessed. This can cause unhandled promise rejections to appear in error tracking tools like Rollbar/Sentry. We must attach catch handlers to all three promises immediately to prevent these unhandled rejections. See: https://bugzilla.mozilla.org/show_bug.cgi?id=1999336 (if applicable) Spec: https://drafts.csswg.org/css-view-transitions-1/#dom-viewtransition-updatecallbackdone
This commit is contained in:
parent
4dc5ae54a9
commit
9e043decaf
1 changed files with 5 additions and 0 deletions
|
|
@ -94,6 +94,11 @@ export function createViewTransition(
|
|||
// complete (below), which includes the update phase of the routed components.
|
||||
return createRenderPromise(injector);
|
||||
});
|
||||
transition.updateCallbackDone.catch((error) => {
|
||||
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
transition.ready.catch((error) => {
|
||||
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
||||
console.error(error);
|
||||
|
|
|
|||
Loading…
Reference in a new issue