"Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten
See original GitHub issueThere is error when exceljs is used in code.
Error:
Error: “Zone.js has detected that ZoneAwarePromise (window|global).Promise
has been overwritten.
Most likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)”
Angular 5
o exceljs.min.js:3
My service.ts file
import { Injectable } from '@angular/core';
import * as Excel from "exceljs/dist/exceljs.min.js";
import * as fs from 'file-saver';
@Injectable({
providedIn: 'root'
})
export class ExcelserviceService {
constructor() { }
generatereport(dummydata):void{
let workbook = new Excel.Workbook();
let worksheet = workbook.addWorksheet('Car Data');
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
Unhandled promise rejection: Zone.js has detected that ...
Unhandled promise rejection: Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten ; "site-pinger" · "version" ...
Read more >Zone.js has detected that ZoneAwarePromise `(window|global ...
Error: "Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten. Most likely cause is that a Promise ...
Read more >Angular – Zone.js has detected that ZoneAwarePromise ...
Angular – Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten in custom element.
Read more >Js (forked) - StackBlitz
Promise !==D. ZoneAwarePromise)throw new Error("Zone.js has. detected that ZoneAwarePromise `(window|. global).Promise` has been overwritten.\nMost.
Read more >Error: Zone.js has detected that ZoneAwarePromise (window
Ng test zone js has detected that ZoneAwarePromise window global Promise has been overwritten · Unhandled Promise rejection Zone: <root> ; Task: Promise...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed mine by importing it before ‘core-js’ and ‘zone.js’ in the pollyfills.ts file
pollyfills.ts file:
I suggested a PR that should fix this issue. You can download it and build to test the excelis.min files.
It worked for me i did not need to import in the polyfill.ts anymore.