-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Error: Zone already loaded. #1597
Comments
Hello, I have exactly the same issue than you. I think it's because of the version of angularfire2 but not sure, I will try something and if it works I will tell you. |
Change this version in your package.json
|
Still happens 👎 |
+1 |
@jamesdaniels , I think the issue is here, https://github.com/angular/angularfire2/blob/master/src/core/angularfire2.ts#L11, Do we just need the
has already been loaded, so I am not sure why we need to import |
thanks you @JiaLiPassion |
+ RC 7 got a bug with zone already loaded in their node_modules. + Will revert back when the fix is impemented. --- angular/angularfire#1597
@JiaLiPassion , i try to modify nodes_modules/angularfire2/angularfire2.js and nodes_modules/angularifre2.d.ts in my project, but i have same error ? |
@Celtiore, you can try the attached zip file , and I also updated your project, import {Injectable, NgZone} from '@angular/core';
import {AngularFirestore} from 'angularfire2/firestore';
import {firebaseConfig} from '../../app/app.module';
@Injectable()
export class AfProvider {
canUexplainMe2: any;
afsClient: AngularFirestore;
constructor(private ngZone: NgZone) {
console.log('Hello AfProvider Provider');
}
createAFS() {
this.afsClient = new AngularFirestore(
firebaseConfig, 'firebaseUsers', false, 'can you explain me',
this.ngZone);
}
} |
Ok, i try later, |
thanks you so much, can't wait later to try :) :) :) working fine repo updated : https://github.com/Celtiore/test-angularfire2 Can we close this issue ? |
@Celtiore , thank you for confirm, I am not sure why |
@JiaLiPassion I am not sure why import 'zone.js' --> I think that fixed the problem when angularfire is running outside angular... like in nodejs for server side rendering... |
@AnthonyNahas , in |
I am facing same issue "Zone already loaded". Can you please help me. See below info Version info Angular: Other (e.g. Ionic/Cordova, Node, browser, operating system): Debug output Error: Zone already loaded. |
@Nilesh-TA , for now, you can downgrade to |
Thanks @JiaLiPassion. I will try this. |
@JiaLiPassion |
@JiaLiPassion well done. i fixed it with zip which you uploaded. |
i hav same problem, |
this is solved in 5.0.0-rc.5-next, but i had to downgrade firebase to firebase@^4.13.1 |
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. |
Didn't work for me!
I'm using Angular 6. Any suggestions? |
Solution to zone issue: |
Hi,
1/ thanks you for your great job
2/ sorry for my english, i'm french :)
3/ i'm a beginner
4/ i'm not sure it's a bug
5/ i'm not sure it's the right place
this morning i'have updated "angularfire2": "^5.0.0-rc.6" to "angularfire2": "^5.0.0-rc.7"
6/ my working code with rc.6 does not work anymore
this.afsClient = new AngularFirestore(_firebaseAppFactory(configFirebase, 'firebaseClient'), false);
because with rc.7 :
(alias) new AngularFirestore(config: FirebaseOptions, name: string, shouldEnablePersistence: boolean, platformId: Object, zone: NgZone)
7/ i start a new blank project ( see github link below ) and now i have the zone.js error !
8/ can you explain me the correct syntax for platformId: Object, zone: NgZone
9/ thanks you
Version info
Angular:
"@angular/common": "5.2.10"
Firebase:
"firebase": "^4.13.1"
AngularFire:
"angularfire2": "^5.0.0-rc.7"
Other (e.g. Ionic/Cordova, Node, browser, operating system):
"ionic-angular": "3.9.2"
How to reproduce these conditions
https://github.com/Celtiore/test-angularfire2
Debug output
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 5a89165deffa5ae45da5:54)
at Object.defineProperty.value (vendor.js:77357)
at webpack_require (bootstrap 5a89165deffa5ae45da5:54)
at Object. (vendor.js:125168)
at webpack_require (bootstrap 5a89165deffa5ae45da5:54)
The text was updated successfully, but these errors were encountered: