Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

class AngularfireModule is not an angular module

I tried to use firebase in my Angular app:

import {AngularFireModule} from 'angularfire2';
import {AngularFireDatabaseModule} from 'angularfire2/database';
import {environment} from '../environments/environment';
...

@NgModule({
    ...
    imports: [
        BrowserModule,
        ...
        AngularFireDatabaseModule,
        AngularFireModule.initializeApp(environment.firebaseConfig, 'my-app')
    ],
    ...
})

However, I got an error:

class AngularfireModule is not an Angular Module

and

class AngularFireDatabaseModule is not an Angular Module

I don't know if this is the correct way to use Firebase with Angular 8, or if there is another way.

like image 558
YCF_L Avatar asked Oct 15 '25 05:10

YCF_L


1 Answers

You need to download @angular/fire not angularfire2. angularfire2 is an old version of @angular/fire.

Angular 6+ or 7/8+ command ng add @angular/fire.

like image 82
Mises Avatar answered Oct 17 '25 20:10

Mises