Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zone.js ZoneAwarePromise Error #141

Open
cnmoro opened this issue Sep 16, 2019 · 4 comments
Open

Zone.js ZoneAwarePromise Error #141

cnmoro opened this issue Sep 16, 2019 · 4 comments

Comments

@cnmoro
Copy link

cnmoro commented Sep 16, 2019

Hello, after integrating freedraw with my project, it shows this error on page load and nothing works:

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.)

All I did was add:

const freeDraw = new FreeDraw();
map.addLayer(freeDraw);

@AndreasOlausson
Copy link

AndreasOlausson commented Sep 20, 2019

We have had the same problem with angular (7/8).
We ended up with a fork where we added the same core-js polyfills that angular does to avoid the zone.js conflict.

FreeDraw.js:

delete:
import 'core-js';

add:
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
import 'core-js/es6/regexp';
import 'core-js/es6/map';
import 'core-js/es6/weak-map';
import 'core-js/es6/set';

@cnmoro
Copy link
Author

cnmoro commented Sep 20, 2019

thank you for the comment ! I'll try your solution and post the results later

@FedericoAndreoli
Copy link

Hi guys,
i'm having the same issue but i'm not understanding how to make it work...
I've installed the package with npm and i don't have the source code, so i dinìt know where to modify the imports...

Can you please help me?

@chriswilley
Copy link

In my case, updating zone.js to 0.10.3 solved this issue.

angular/angular#31724 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants