Our state of the art Gantt chart


Post by cedric.lamalle »

Hello,
We are having the following error with our Code when loaded in the Firefox browser:

Error: Zone.js has detected that ZoneAwarePromise (window | global) .Promise has been overwritten.

We made the change suggested in the topic: viewtopic.php?p=69856#p69856. The suggested change solves the problem in development mode, but the same error occurs if you build the application in production mode.
Do you have any other suggestions for trying to solve the problem?

Regards,
Cédric.

Edit:
Versions:
Angular 5.2.11
bryntum-gantt 2.1.4
Firefox 81.0 (64-bits)


Post by saki »

We are working on a permanent solution of this problem but there is a workaround you can use immediately.

This happens because we define Promise as a polyfill to increase the browser compatibility. Therefore, if gantt.umd.js is loaded after zone.js then Promise is redefined, this situation is detected and the error is thrown. Therefore, if we load zone.js after our umd bundle, it will work.

For that:

  1. comment line that imports zone.js in src/polyfills.ts

    // import 'zone.js/dist/zone';  // Included with Angular CLI.
  2. add import to src/main.ts as the last import:

    // Moved from polyfills.ts to main.ts for proper support of UMD bundle which contains polyfills.
    import 'zone.js/dist/zone';  // Included with Angular CLI.

Post by cedric.lamalle »

Hello,
Thanks for the answer, I will try this.

Thanks,
Cédric.


Post by fabio.mazza »

Great Cedric, please keep us updated if it works. Thank's!

Best regards,
Fabio


Post by cedric.lamalle »

Hello,
While testing it, I realized that it was exactly the same workaround than of viewtopic.php?p=69856#p69856
So this is working in development mode, but not after the code has been built in production mode it doesn't work anymore.

Regards,
Cédric.


Post by saki »

Hello Cédric,

we use the same approach for Scheduler and it works there in Angular 5 so there must be some difference either between Scheduler and Gantt or between our demo and your app. Could you please post a minimal showcase that demonstrates the problem?

Then we can run it locally, debug and fix the problem.

Thank you.


Post by saki »

Hello Cédric,

I have tested the issue and indeed it works in development mode but when the application is compiled with --prod switch then it doesn't work in Firefox or Safari. So no need to prepare a showcase on your end; we can reproduce the issue.

We will address it on priority early next week when we will provide a solution.


Post by saki »

One more thing to try:

npm i zone.js@latest

in you project root. Version 0.11.1 works for me so far w/o negative consequences. Try it please and let us know if it worked.


Post by cedric.lamalle »

Hello Saki,
I will try it on monday.

Thanks for the answer!
Cédric.


Post by saki »

Thank you Cédric. Let us know the result then.


Post Reply