I've recently installed firebase via npm but when i try to import it and set it as a dependency to my app module I get this error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module app-bootstrap due to: Error: [$injector:modulerr] Failed to instantiate module firebase due to: Error: [$injector:nomod] Module 'firebase' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
I'm using import "firebase" in my main.js file. Every other import works except for firebase.
What could be the issue ?
main.js :
import 'angular';
import 'angular-ui-router';
import 'angular-animate';
import * as firebase from 'firebase';
import 'angularfire';
// Libs wrapper
import 'assets/css/main.scss'
// Module wrapper
import 'modules';
let config = {
apiKey: "",
authDomain: "",
databaseURL: "",
projectId: "",
storageBucket: "",
}
firebase.initializeApp(config);
angular
.module('app-bootstrap', [
'ui.router',
'ngAnimate',
'firebase',
'modules'
])
angular.element(document).ready(function() {
angular.bootstrap(document, ['app-bootstrap']);
});
Random controller:
export function authCtrl($firebaseAuth) {
let vm = this;
vm.authObj = $firebaseAuth();
}
Later edit:
I managed to solve the Uncaught Error and now I get a different error "ReferenceError: firebase is not defined"