@@ -30,11 +30,19 @@ import {BrowserModule} from '@angular/platform-browser';
3030import {NgModule } from ' @angular/core' ;
3131import {FormsModule } from ' @angular/forms' ;
3232import {AppComponent } from ' ./app.component' ;
33- import {FirebaseUIModule } from ' firebaseui-angular' ;
3433import {environment } from ' ../environments/environment' ;
3534import {AppRoutingModule } from ' ./app-routing.module' ;
36- import * as firebase from ' firebase/app/dist/index.esm' ;
37- import * as firebaseui from ' firebaseui/dist/firebaseui.js' ;
35+
36+
37+ import {FirebaseUIModule } from ' firebaseui-angular' ;
38+ import * as firebase from ' firebase/app' ;
39+ import * as firebaseui from ' firebaseui' ;
40+ // currently there is a bug while building the app with --prod
41+ // - https://github.com/RaphaelJenni/FirebaseUI-Angular/issues/76
42+ // the plugin exposes the two libraries as well. You can use those:
43+ import {FirebaseUIModule , firebase , firebaseui } from ' firebaseui-angular' ;
44+
45+
3846import {AngularFireModule } from ' @angular/fire' ;
3947import {AngularFireAuthModule } from ' @angular/fire/auth' ;
4048
@@ -222,6 +230,18 @@ $ npm run lint
222230There are test files, but they are empty at the moment.
223231
224232## Troubleshoot
233+ ### Prod build error
234+ ```
235+ ERROR in ./src/app/app.module.ngfactory.js
236+ Module not found: Error: Can't resolve 'firebase/index' in '...'
237+ ERROR in ./src/app/app.module.ngfactory.js
238+ Module not found: Error: Can't resolve 'firebaseui/dist/index' in '...'
239+ ```
240+
241+ Use the firebase and firebaseui instances exposed by the plugin:
242+
243+ ` import {..., firebase, firebaseui} from 'firebaseui-angular'; `
244+
225245### CSS not loaded
226246If you have added the css to the angular.json but nothing happened. Try to restart the server (` Ctrl-C ` and ` ng serve ` )
227247
0 commit comments