Home > database >  ERROR in node_modules/@firebase/firestore/dist/index.d.ts:27:28 - error TS1005: ']' expect
ERROR in node_modules/@firebase/firestore/dist/index.d.ts:27:28 - error TS1005: ']' expect

Time:04-27

I tried to include firebase to my angular app, I import all but when I run ng serve I have this error

ERROR in node_modules/@firebase/firestore/dist/index.d.ts:27:28 - error TS1005: ']' expected.

27     [K in keyof T & string as `${Prefix}.${K}`] ?: T[K];
                              ~~
node_modules/@firebase/firestore/dist/index.d.ts:27:47 - error TS1005: ';' expected.

27     [K in keyof T & string as `${Prefix}.${K}`] ?: T[K];
                                                 ~
node_modules/@firebase/firestore/dist/index.d.ts:27:49 - error TS1109: Expression expected.

27     [K in keyof T & string as `${Prefix}.${K}`] ?: T[K];
                                                   ~
node_modules/@firebase/firestore/dist/index.d.ts:27:50 - error TS1109: Expression expected.

27     [K in keyof T & string as `${Prefix}.${K}`] ?: T[K];
                                                    ~
node_modules/@firebase/firestore/dist/index.d.ts:28:1 - error TS1128: Declaration or statement expected.

28 };

I serched in internet and I found many info about this.

I tried to downgrade @angular/fire package to 6.1.5, I tried to increment typescript version, I tried to reinstall node_modules, I tried all of internet solution, but I don't know how I can solve it. I use Anguar 10

this is package.json

{
  "name": "xxxxxxxx",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~10.2.4",
    "@angular/cdk": "^10.2.7",
    "@angular/common": "~10.2.4",
    "@angular/compiler": "~10.2.4",
    "@angular/core": "~10.2.4",
    "@angular/fire": "^7.3.0",
    "@angular/forms": "~10.2.4",
    "@angular/material": "^10.2.7",
    "@angular/platform-browser": "~10.2.4",
    "@angular/platform-browser-dynamic": "~10.2.4",
    "@angular/router": "~10.2.4",
    "@datorama/akita-ng-entity-service": "^7.0.0",
    "@ngrx/store": "^10.1.2",
    "angularfire2": "^5.0.0-rc.7",
    "bootstrap": "^5.1.3",
    "firebase": "^9.0.2",
    "normalize.css": "^8.0.1",
    "rxjs": "~6.6.0",
    "sha1": "^1.1.1",
    "tslib": "^2.4.0",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.1002.3",
    "@angular/cli": "~10.2.3",
    "@angular/compiler-cli": "~10.2.4",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.20.49",
    "codelyzer": "^6.0.0",
    "jasmine-core": "~3.6.0",
    "jasmine-spec-reporter": "~5.0.0",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~3.0.2",
    "karma-jasmine": "~4.0.0",
    "karma-jasmine-html-reporter": "^1.5.0",
    "protractor": "~7.0.0",
    "sass": "^1.50.1",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "^4.0.8"
  }
}

CodePudding user response:

I solved myself, I used @angular/fire 6.1.5 and firebase 8.10.0, I deleted node_modules, I added manually package in package.json and reinstalled with npm install

  • Related