diff --git a/packages/zone.js/lib/common/error-rewrite.ts b/packages/zone.js/lib/common/error-rewrite.ts index ccb5ffac258..04eb8d34e8e 100644 --- a/packages/zone.js/lib/common/error-rewrite.ts +++ b/packages/zone.js/lib/common/error-rewrite.ts @@ -10,23 +10,6 @@ * @suppress {globalThis,undefinedVars} */ -declare global { - /** - * Extend the Error with additional fields for rewritten stack frames - */ - interface Error { - /** - * Stack trace where extra frames have been removed and zone names added. - */ - zoneAwareStack?: string; - - /** - * Original stack trace with no modifications - */ - originalStack?: string; - } -} - Zone.__load_patch('Error', (global: any, Zone: ZoneType, api: _ZonePrivate) => { /* * This code patches Error so that: diff --git a/packages/zone.js/lib/zone.ts b/packages/zone.js/lib/zone.ts index 6636adffbc3..431bad090f4 100644 --- a/packages/zone.js/lib/zone.ts +++ b/packages/zone.js/lib/zone.ts @@ -26,6 +26,21 @@ declare global { type MicroTask = _MicroTask; type MacroTask = _MacroTask; type EventTask = _EventTask; + + /** + * Extend the Error with additional fields for rewritten stack frames + */ + interface Error { + /** + * Stack trace where extra frames have been removed and zone names added. + */ + zoneAwareStack?: string; + + /** + * Original stack trace with no modifications + */ + originalStack?: string; + } } // if global['Zone'] already exists (maybe zone.js was already loaded or