Importing AngularFireAuthModule and FirebaseUI-Angular module only in feature module
See original GitHub issueI want to import AngularFireAuthModule,firebase/auth,firebaseui module only in feature module(login module) and not in AppModule because the ‘firebase/auth’ module takes around 160 kb in main production bundle size which increases the initial load time. Is there a way I can do this and also be able to use this library ? because right now when I am trying to do it I am getting an error shown below;
StaticInjectorError(AppModule)[FirebaseuiAngularLibraryComponent -> AngularFireAuth]:
StaticInjectorError(Platform: core)[FirebaseuiAngularLibraryComponent -> AngularFireAuth]:
NullInjectorError: No provider for AngularFireAuth!
at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:8896)
at resolveToken (core.js:9141)
at tryResolveToken (core.js:9085)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8982)
at resolveToken (core.js:9141)
at tryResolveToken (core.js:9085)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:8982)
at resolveNgModuleDep (core.js:21218)
at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:21907)
at injectInjectorOnly (core.js:1774)
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Has firebaseUI no 'keep me signed in' option? - Stack Overflow
module.ts: import {AngularFireModule} from '@angular/fire'; import {AngularFireAuthModule} ...
Read more >Feature modules - Angular
Feature modules import CommonModule instead of BrowserModule , which is only imported once in the root module. CommonModule only contains information for ...
Read more >firebaseui-angular-v10 - npm Package Health Analysis - Snyk
Add the FirebaseUIModule with the config to your imports. Make sure you have initialized AngularFire correctly. import {BrowserModule} from '@ ...
Read more >Firebase Authentication With Angular - LinkedIn
But in this tutorial I added only Google Provider. ... import { AngularFireModule } from 'angularfire2'; import { AngularFireDatabaseModule } ...
Read more >Firebase + Angular: Setup and Auth - Induro
We are going to import the Firestore, Auth, and Storage modules as well as we will want them later. import { BrowserModule }...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Perfect, I will release the bugfix later today.
Hi You should be able to import the module with forRoot in the feature module without any problems. Please give it a try and tell me if you encounter any errors.