#

Angular Error: NullInjectorError: No provider for AngularFireDatabase!  Code  core.js: 5967

 

 

Error Code  core.js: 5967

Fehler beim Anbinden von Angular Module Firebase

Fehlermeldung

 

core.js:5967 ERROR NullInjectorError: R3InjectorError(AppModule)[AngularFireDatabase -> AngularFireDatabase -> AngularFireDatabase]:

  NullInjectorError: No provider for AngularFireDatabase!

 

 

 

In the Chrome browser in the Console

 

core.js:5967 ERROR NullInjectorError: R3InjectorError(AppModule)[AngularFireDatabase -> AngularFireDatabase -> AngularFireDatabase]:

  NullInjectorError: No provider for AngularFireDatabase!

    at NullInjector.get (http://localhost:4200/vendor.js:38773:27)

    at R3Injector.get (http://localhost:4200/vendor.js:38940:33)

    at R3Injector.get (http://localhost:4200/vendor.js:38940:33)

    at R3Injector.get (http://localhost:4200/vendor.js:38940:33)

    at NgModuleRef$1.get (http://localhost:4200/vendor.js:52996:33)

    at Object.get (http://localhost:4200/vendor.js:52710:35)

    at lookupTokenUsingModuleInjector (http://localhost:4200/vendor.js:31259:39)

    at getOrCreateInjectable (http://localhost:4200/vendor.js:31371:12)

    at Module.ɵɵdirectiveInject (http://localhost:4200/vendor.js:42378:12)

    at NodeInjectorFactory.AppComponent_Factory [as factory] (http://localhost:4200/main.js:88:150)

 

 

Und zusätzlich wird in ng serve local Webserver angezeigt:

 

app.component.ts depends on 'angularfire2/database'.

CommonJS or AMD dependencies can cause optimization bailouts.

For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

 

 

 

 

Warning: D:\Programmierung\Angular\Kurs\dailycheck\src\app\app.component.ts depends on 'angularfire2/database'. CommonJS or AMD dependencies can cause optimization bailouts.

For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

 

Warning: D:\Programmierung\Angular\Kurs\dailycheck\node_modules\@angular\fire\__ivy_ngcc__\es2015\firebase.app.module.js depends on 'firebase/app'. CommonJS or AMD dependencies can cause optimization bailouts.

For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

 

Warning: D:\Programmierung\Angular\Kurs\dailycheck\node_modules\firebase\database\dist\index.esm.js depends on '@firebase/database'. CommonJS or AMD dependencies can cause optimization bailouts.

For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

 

 

Lösung:

Man muss das Angular Modul in der Angular app.component.ts Datei eintragen an zwei Stellen

1: im Import oben im Header

import { AngularFireDatabaseModule } from '@angular/fire/database';

und

2: im @NgModule imports Bereich

  imports: [

    BrowserModule,

    AngularFireModule.initializeApp(firebaseConfig), 

    AngularFireDatabaseModule

  ],

 

Mobile

.

0123movie.net