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

import 'zone.js' which may cause duplicate #99

Closed
vincent-cm opened this issue May 24, 2018 · 11 comments
Closed

import 'zone.js' which may cause duplicate #99

vincent-cm opened this issue May 24, 2018 · 11 comments

Comments

@vincent-cm
Copy link

vincent-cm commented May 24, 2018

After installing the 6.0.0-beta.1
The AoT build will throw an error at runtime:

Uncaught Error: Zone already loaded.

As ./modules/core/src/interruptsource.ts has zone.js imported which I think it is not necessary

@sherlock1982
Copy link

Well Zone should be loaded prior Angular. So every user should do it for himself before. IMHO no other components should reference Zone directly.

@jtcrowson
Copy link

Getting the same error after install 6.0.0-beta.1

● Test suite failed to run

    Zone already loaded.
      
      at node_modules/zone.js/dist/zone-node.js:32:15
      at node_modules/zone.js/dist/zone-node.js:644:3
      at Object.<anonymous>.FUNCTION (node_modules/zone.js/dist/zone-node.js:9:65)
      at Object.<anonymous> (node_modules/zone.js/dist/zone-node.js:12:2)
      at node_modules/@ng-idle/core/bundles/core.umd.js:2:155
      at Object.<anonymous> (node_modules/@ng-idle/core/bundles/core.umd.js:5:2)
      at Object.<anonymous> (src/app/auth/services/activity-monitor.service.spec.ts:5:14)
          at Generator.next (<anonymous>)
          at new Promise (<anonymous>)
          at Generator.next (<anonymous>)

@richie50
Copy link

@jtcrowson having this same issue. any quick fixes

@vincent-cm
Copy link
Author

@richie50 try to comment out all the import 'zone.js' from the source

@richie50
Copy link

@vincent-cm when i comment out zone js from my package.json my app doesn't load at all. I get zone js cannot be found. Did you experience that?

@vincent-cm
Copy link
Author

vincent-cm commented May 30, 2018

@richie50 I mean the source code from ./node_modules/ng2-idle/ but not recommend, better to download the ng2-idle source and insert into your own project.

@richie50
Copy link

@vincent-cm thanks will do 👍

@jtcrowson
Copy link

Appreciate the workaround, but of course, don't want to commit my node_modules to source control. @hackedbychinese is this workaround in consideration for implementation?

@sherlock1982
Copy link

I used patch-package for it. It's amazing for doing small patches in published libs.

@jtcrowson
Copy link

Good call @sherlock1982. Thanks!!

@richie50
Copy link

richie50 commented May 30, 2018

I have a fix. i will be submitting a pull request soon. Works with angular 6.0.3. Pull request submitted please review @sherlock1982 @vincent-cm @jtcrowson @hackedbychinese

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