Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Uncaught Error: Zone already loaded #405

Closed
CanKer opened this issue Aug 18, 2016 · 30 comments · Fixed by #728
Closed

Uncaught Error: Zone already loaded #405

CanKer opened this issue Aug 18, 2016 · 30 comments · Fixed by #728

Comments

@CanKer
Copy link

CanKer commented Aug 18, 2016

I don't really know how it happened but I got the "Uncaught Error: Zone already loaded" error in my console after doing some POST petitions. The functionality it's ok, but the look of the app it changes.

screen shot 22

@hctomkins
Copy link

+1

@AGoodnight
Copy link

AGoodnight commented Sep 1, 2016

Make sure your not loading the module twice, I had it hiding in my index file:

...
<script src="node_modules/zone.js/dist/zone.js"></script>  // <-- I removed this
...

Incidentally if you load it more than once you screw up the router a bit. You need to click your routing links multiple times when this bug arises after loading it too many times.

@jgf5013
Copy link

jgf5013 commented Sep 14, 2016

EDIT: The problem was actually that I was including the script twice. Actually, I was including another script (which had zone as a dependency) twice.

@hctomkins
Copy link

hctomkins commented Sep 15, 2016

It was the same with me. If this happening to you, try removing where you include zone.js from your index.html

@Splaktar
Copy link
Member

Splaktar commented Nov 1, 2016

This looks like a project configuration issue rather than a Zone.js bug. That said, the error message could be more helpful. It should specify the name of the zone that is already loaded or some identifying information. In my case, the stack trace pointed to three different source files in my code, none of which were really helpful.

For me, this ended up being an issue with my Polymer dependencies from Bower. If I am missing a Polymer dependency, then this error occurs saying Uncaught Error: Zone already loaded. Fixing my bower.json and my imports in elements.html resolved the error.

@gandra
Copy link

gandra commented Apr 7, 2017

Angular has a terrible debug feedback ... zone not loaded ... thank you very much!

Look at the quality of provided info (this is my case) ... all test pass ok, build pass ok, deploy pass and in the runtime I found this:

Uncaught Error: Zone already loaded.
    at /vendor.bundle.js:129468:15 [<root>]
    at /vendor.bundle.js:130572:3 [<root>]
    at NO_ZONE.name (vendor.bundle.js:129454) [<root>]
    at Object.<anonymous> (vendor.bundle.js:129457) [<root>]
    at Object.<anonymous> (vendor.bundle.js:131514) [<root>]
    at __webpack_require__ (inline.bundle.js:53) [<root>]
    at Object.378 (main.bundle.js:2231) [<root>]
    at __webpack_require__ (inline.bundle.js:53) [<root>]
    at Object.343 (main.bundle.js:235) [<root>]
    at __webpack_require__ (inline.bundle.js:53) [<root>]
    at Object.824 (main.bundle.js:3100) [<root>]
    at __webpack_require__ (inline.bundle.js:53) [<root>]
    at webpackJsonpCallback (inline.bundle.js:24) [<root>]
    at /main.bundle.js:1:1 [<root>]

@JiaLiPassion
Copy link
Collaborator

Thank you for all the information , I will try to make the error message more helpful.

@gandra
Copy link

gandra commented Apr 8, 2017

Kudos to @JiaLiPassion for attitude!

@JiaLiPassion
Copy link
Collaborator

@gandra , thank you!!

@rgbsuede
Copy link

rgbsuede commented May 3, 2018

Hmmm

vendor.js:124539 Uncaught Error: Zone already loaded.
    at vendor.js:124539
    at vendor.js:125151
    at FUNCTION (vendor.js:124516)
    at Object.<anonymous> (vendor.js:124519)
    at Object.<anonymous> (vendor.js:127569)
    at __webpack_require__ (vendor.js:55)
    at Object.<anonymous> (vendor.js:77767)
    at __webpack_require__ (vendor.js:55)
    at Object.<anonymous> (vendor.js:124034)
    at __webpack_require__ (vendor.js:55)

@herkulano
Copy link

Also getting this error running tests

  ● Test suite failed to run

    Zone already loaded.

    > 6 | import { Observable } from 'rxjs'

@guillop
Copy link

guillop commented May 9, 2018

fix:
npm install angularfire2@5.0.0-rc.4

@rahuljograna
Copy link

This is the problem of new firebase update, here is a solution for this error

** Step: 1** Install the lower version of firebase using this command

npm install angularfire2@5.0.0-rc.4

** Step: 2**

npm install

Try.

@anoopmv6
Copy link

anoopmv6 commented May 12, 2018

I was facing this problem for last few days..Now I am get out of this "zone already loaded error" from the following way....!

Step 1: Degrade firebase version to lower by typing npm install angularfire2@5.0.0-rc.4

Step 2: run npm install

@mehtaparam
Copy link

Ty @rahuljograna @anoopmv6 @guillop solution is working

@GonzaloUNAB2018
Copy link

thanks for your answers!! it working!
see ya!

@anoopmv6
Copy link

welcome Gonzalo

@arjun526nag
Copy link

Uncaught Error: Zone already loaded.
at zone.js:32
at zone.js:644
at FUNCTION (zone.js:9)
at Object. (zone.js:12)
at Object. (zone.js:3060)
at webpack_require (bootstrap 6613f924a1108f55b2e9:54)
at Object.defineProperty.value (vendor.js:69159)
at webpack_require (bootstrap 6613f924a1108f55b2e9:54)
at Object. (vendor.js:117173)
at webpack_require (bootstrap 6613f924a1108f55b2e9:54)

please help us..i try it npm install angularfire2@5.0.0-rc.4 and npm install also but not working

@anoopmv6
Copy link

arjun..
after update angularfire run npm install

@arjun526nag
Copy link

i am trying this command it's wrkng for me. npm install firebase@4.8.0

@davidenke
Copy link

@JiaLiPassion wouldn't it be better to check if zone.js is already initialized? We for example use @angular/elements to create web components. And in some cases they're used inside other Angular applications. So both have to provide zone.js as dependency.

@JiaLiPassion
Copy link
Collaborator

@davidenke, sure, this has been fixed here #1093

@davidenke
Copy link

@JiaLiPassion but that exposes a flag to allow users to check for themselves if zone.js is loaded, right?

@JiaLiPassion
Copy link
Collaborator

@davidenke , I have changed PR title, when the flag is true, the Zone is already loaded error will be thrown, by default, this error will not be thrown.

@amitesh786
Copy link

Make sure your not loading the module twice, I had it hiding in my index file:

...
<script src="node_modules/zone.js/dist/zone.js"></script>  // <-- I removed this
...

Incidentally if you load it more than once you screw up the router a bit. You need to click your routing links multiple times when this bug arises after loading it too many times.

I agree, but I just remove some more link related to zone -

I have seen this problem, so I just remove as well as I create system.config.js file that contain info related to link & all script it works perfect.

@robermorales
Copy link

@davidenke , I have changed PR title, when the flag is true, the Zone is already loaded error will be thrown, by default, this error will not be thrown.

Which is the intended process to get this fix inside a running angular 6 application? It seems that the fix is in the zone.js master branch but the latest npm release is from 8 months ago.

Thanks,

@JiaLiPassion
Copy link
Collaborator

Please wait for a little more longer, the new version will be released soon.

@fishbone1
Copy link

This error can also occur if you export symbols at the bottom of polyfills.ts and import them in another ts file of your application.

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