angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Error when importing AngularFirestore from @angular/fire/firestore

Open armanhadifatah opened this issue 5 years ago • 6 comments

Hello Dear i have this problem in my Angular application .

Everything works well but when i import AngularFirestore i get this weird error and the app crash

This is my import in one of my service.ts

import { AngularFirestore } from '@angular/fire/firestore';
import { AngularFireAuth } from '@angular/fire/auth';

This is the error i get

Build at: 2021-06-05T08:24:45.240Z - Hash: 3cc5310386f83cfeb2b5 - Time: 9817ms
[ng] ./node_modules/@firebase/firestore/dist/esm5/prebuilt-db9cc925-eb007c37.js:9880:56-57 - Error: export 'FetchXmlHttpFactory' (imported as 'v') was not found in '@firebase/webchannel-wrapper' (possible exports: ErrorCode, Event, EventType, Stat, WebChannel, XhrIo, createWebChannelTransport, default, getStatEventTarget)

My package.json file


{
  "name": "waneelectron",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~12.0.1",
    "@angular/core": "~12.0.1",
    "@angular/fire": "^6.1.5",
    "@angular/forms": "~12.0.1",
    "@angular/platform-browser": "~12.0.1",
    "@angular/platform-browser-dynamic": "~12.0.1",
    "@angular/router": "~12.0.1",
    "@capacitor/app": "1.0.0",
    "@capacitor/core": "3.0.0",
    "@capacitor/haptics": "1.0.0",
    "@capacitor/keyboard": "1.0.0",
    "@ionic/angular": "^5.5.2",
    "firebase": "^8.6.4",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~12.0.1",
    "@angular-eslint/builder": "~12.0.0",
    "@angular-eslint/eslint-plugin": "~12.0.0",
    "@angular-eslint/eslint-plugin-template": "~12.0.0",
    "@angular-eslint/template-parser": "~12.0.0",
    "@angular/cli": "~12.0.1",
    "@angular/compiler": "~12.0.1",
    "@angular/compiler-cli": "~12.0.1",
    "@angular/language-service": "~12.0.1",
    "@capacitor/cli": "3.0.0",
    "@ionic/angular-toolkit": "^4.0.0",
    "@types/jasmine": "~3.6.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
    "@typescript-eslint/eslint-plugin": "4.16.1",
    "@typescript-eslint/parser": "4.16.1",
    "eslint": "^7.6.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.6",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "~3.7.1",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~6.3.2",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.0.3",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "ts-node": "~8.3.0",
    "typescript": "~4.2.4"
  },
  "description": "An Ionic project"
}

armanhadifatah avatar Jun 05 '21 08:06 armanhadifatah

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jun 05 '21 08:06 google-oss-bot

This is a bug with the Firebase JS SDK, a patch has been deployed to NPM as I understand it.

jamesdaniels avatar Jun 05 '21 18:06 jamesdaniels

solucion?

solenmarketing avatar Jun 07 '21 14:06 solenmarketing

  1. delete node_modules folder
  2. delete package-lock.json
  3. npm i
  4. npm i @firebase/webchannel-wrapper --save

lucafulgenzi avatar Jun 13 '21 10:06 lucafulgenzi

@google-oss-bot this is big issue in Firebase JS SDK side

Hasintha-git avatar May 31 '22 17:05 Hasintha-git

I have the same issue, I tried to downgrade firebase package but I keep having this error message trying to compile with rollup (3.7.4)

vdegenne avatar Dec 16 '22 18:12 vdegenne