Issue with Ionic and Firebase Auth

I am getting this when I add in the signInWithEmailAndPassword or createUserWithEmailAndPassword

Error: Uncaught (in promise): Error: Your API key is invalid, please check you have copied it correctly.

I am using firebase with ionic. I am using AngularFireAuth, and have the credentials in a const FIREBASE_CONFIG = {
authDomain: “XXXXXXXX”,
databaseURL: “XXXXXXXXX”,
projectId: “XXXXXXXXX”,
storageBucket: “XXXXXXXX”,
messagingSenderId: “XXXXXXXXX”
All of these copied from the firebase include in webapp. multiple times to make sure they are correct.

Has anyone else been experiencing issues with the latest update to firebase?

No. What’s your app.module.ts?

import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { StatusBar } from ‘@ionic-native/status-bar’;
import { firebase } from “@firebase/app”;
import { AngularFireModule } from ‘angularfire2’;
import { AngularFireAuthModule } from ‘angularfire2/auth’;

import { MyApp } from ‘./app.component’;
import { HomePage } from ‘…/pages/home/home’;
import { FIREBASE_CONFIG } from ‘./app.firebase.config’;

declarations: [
imports: [
bootstrap: [IonicApp],
entryComponents: [
providers: [
{provide: ErrorHandler, useClass: IonicErrorHandler}
export class AppModule {}

And you’re using the most recent AngularFire2, and the version of Firebase that is bundled with it?

yes just checked and installed again to make sure

That looks good. Maybe your sign in code has an issue?

this is the register.ts
import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams } from ‘ionic-angular’;
import { AngularFireAuth } from ‘angularfire2/auth’;
import { User } from ‘…/…/models/user’;


selector: ‘page-register’,
templateUrl: ‘register.html’,
export class RegisterPage {

user = {} as User;

constructor(private afAuth: AngularFireAuth, public navCtrl: NavController, public navParams: NavParams) {

async register(user: User) {
try {
const result = await this.afAuth.auth.createUserWithEmailAndPassword(, user.password);
catch (e) {
ionViewDidLoad() {
console.log(‘ionViewDidLoad RegisterPage’);


the login.ts is similar using signInWithEmailAndPassword(, user.password) within a login function