question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing AngularFireAuthModule and FirebaseUI-Angular module only in feature module

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
RaphaelJennicommented, May 21, 2019

Perfect, I will release the bugfix later today.

1reaction
RaphaelJennicommented, May 20, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found