Home > Net >  @angular/fire throws Error: Module not found: Error: Default condition should be last one
@angular/fire throws Error: Module not found: Error: Default condition should be last one

Time:02-04

I've been using AngularCrashlytics(from @angular/fire) for a while interestingly since this morning I became unable to get either build or ng serve which throws error as below.Can someone help me to get rid of this?

enter image description here

On the app.module I've already added @angular/fire releated configuration steps as below(taken from enter image description here

Dependency versions from package.json

"firebase": "^9.14.0",
"@angular/fire": "^7.4.1"

Additional Note : Already cloned project from scratch many times have tried deleting node modules folder and npm install besides tried to upgrade both firebase and @angular/fire to the latest versions which didn't fix the issue.

CodePudding user response:

The issue is not being solved. Everything was working fine 2 hours back but suddenly these errors start popping up for @angular/firebase.

I tried updating and overriding the firebase to ^9.8.0. But there are 2 errors that persist.

enter image description here

CodePudding user response:

I guess the issue comes from the dependency here: node_modules/@angular/fire/package.json

"dependencies": {
  "firebase": "^9.8.0",

As stated here: https://github.com/firebase/firebase-js-sdk/issues/7005#issuecomment-1415807037

Removing the ^ within the version solved it for me.

I did this in my projects package.json to override it:

{
  "name": "myproject",
  "version": "0.0.0",
  "scripts": ...
  "dependencies": ...
  "devDependencies": {
    ...
  },  
  "overrides": {
    "@angular/fire": {
      "firebase": "9.8.0"
    }
  },

Then run "npm install" to apply this.

Should be fixed in the next release of "@angular/fire".

CodePudding user response:

In package.json add this code:

  "overrides": {
    "@angular/fire": {
      "firebase": "9.8.1"
    }
  }

version from fire is: "@angular/fire": "^7.4.1" and node 16.14.2 with npm 8.5.0 Delete rm -r node_modules package-lock.json .angular Only npm not yarn

  • Related