angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

initializeApp

Open conectafoot opened this issue 2 years ago • 3 comments
trafficstars

The "Firebase Options" interface of the "initializeApp" function does not have the "locationId" attribute.

"dependencies": { "@angular/animations": "^16.2.0", "@angular/cdk": "^16.2.10", "@angular/common": "^16.2.0", "@angular/compiler": "^16.2.0", "@angular/core": "^16.2.0", "@angular/fire": "^16.0.0", "@angular/forms": "^16.2.0", "@angular/material": "^16.2.10", "@angular/platform-browser": "^16.2.0", "@angular/platform-browser-dynamic": "^16.2.0", "@angular/router": "^16.2.0", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.13.0" },

  "...Object literal may only specify known properties, and 'locationId' does not exist in type 'FirebaseOptions'.

Overload 2 of 3, '(options: FirebaseOptions, config?: FirebaseAppSettings | undefined): FirebaseApp', gave the following error. Argument of type '{ projectId: string; appId: string; storageBucket: string; locationId: string; apiKey: string; authDomain: string; messagingSenderId: string; measurementId: string; }' is not assignable to parameter of type 'FirebaseOptions'. Object literal may only specify known properties, and 'locationId' does not exist in type 'FirebaseOptions'.ts(2769)"

conectafoot avatar Oct 28 '23 09:10 conectafoot

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

google-oss-bot avatar Oct 28 '23 09:10 google-oss-bot

Hey, you just have to remove locationId and it's value from the app.module.ts, for some reason they managed to initialize it even though it's not needed, after that you're app should compile just fine

Hendercraft avatar Nov 04 '23 23:11 Hendercraft

As pointed out by @Hendercraft this will simply resolve your issue. And if it has please close this issue.

Sapython avatar Dec 22 '23 14:12 Sapython

thanks

conectafoot avatar Mar 27 '24 18:03 conectafoot

https://firebase.google.com/docs/reference/js/app.firebaseoptions.md#firebaseoptions_interface does not include locationId as an option.

A fix for this issue would be either:

  1. If "locationId" is truly not needed, make it so that running ng add @angular/fire does not add the field to the ApplicationConfig in app.config.ts.
  2. Update FirebaseOptions to include locationId, and update the Firebase docs to document this field.

fredsa avatar Jun 20 '24 23:06 fredsa