Uncaught (in promise): Error: StaticInjectorError(AppModule)


#1

Hi guys, I already connected to firebase and read the data successfully as well but when i rerun the app i got this error in my project please help if anybody knows .Thanks

Runtime Error
Uncaught (in promise): Error: StaticInjectorError(AppModule)[CareerPage -> AngularFireDatabase]: StaticInjectorError(Platform: core)[CareerPage -> AngularFireDatabase]: NullInjectorError: No provider for AngularFireDatabase! Error: StaticInjectorError(AppModule)[CareerPage -> AngularFireDatabase]: StaticInjectorError(Platform: core)[CareerPage -> AngularFireDatabase]: NullInjectorError: No provider for AngularFireDatabase! at NullInjector.get (http://localhost:8100/build/vendor.js:1376:19) at resolveToken (http://localhost:8100/build/vendor.js:1674:24) at tryResolveToken (http://localhost:8100/build/vendor.js:1616:16) at StaticInjector.get (http://localhost:8100/build/vendor.js:1484:20) at resolveToken (http://localhost:8100/build/vendor.js:1674:24) at tryResolveToken (http://localhost:8100/build/vendor.js:1616:16) at StaticInjector.get (http://localhost:8100/build/vendor.js:1484:20) at resolveNgModuleDep (http://localhost:8100/build/vendor.js:11228:25) at NgModuleRef.get (http://localhost:8100/build/vendor.js:12461:16) at resolveDep (http://localhost:8100/build/vendor.js:12951:45)


#2

Are you importing AngularFireDatabaseModule in your CoreModule, for example:

@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    IonicModule,
    AngularFireModule.initializeApp(ENV.firebase),
    AngularFireDatabaseModule
    AngularFireAuthModule,
    ...
  ],
  exports: [],
  declarations: [],
  providers: [
    ...
  ]
})
export class CoreModule {
  constructor( @Optional() @SkipSelf() parentModule: CoreModule) {
     ...
  }
}

#3

No, I have imported now and it worked properly . Thank you so much @robinyo :smile: