mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08: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:
committed by
Kirill Cherkashin
parent
4dc5ae54a9
commit
9e043decaf
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user