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.

Can't resolve firebase and firebaseui while building with AOT

See original GitHub issue

[REQUIRED] Describe your environment

  • Operating System version: Ubuntu 18.04.1 LTS
  • Browser version: Chrome 69.0.3497.81
  • Firebase UI version: 3.4.0
  • Firebase SDK version: 5.4.2

[REQUIRED] Describe the problem

While building a project with AOT. The modules can’t be resolved.

ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'firebase/index' in '/home/Projects/GitHub/FirebaseUI-Angular/src/app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve 'firebaseui/dist/index' in '/home/Projects/GitHub/FirebaseUI-Angular/src/app'

Steps to reproduce:

Run the demo project of FirebaseUI-Angular with ng build --prod

Relevant Code:

src/app/app.module.ts

import * as firebase from 'firebase/app';
import * as firebaseui from 'firebaseui';

const firebaseUiAuthConfig: firebaseui.auth.Config = {
  signInFlow: 'popup',
  signInOptions: [
    firebase.auth.GoogleAuthProvider.PROVIDER_ID,
    {
      scopes: [
        'public_profile',
        'email',
        'user_likes',
        'user_friends'
      ],
      customParameters: {
        'auth_type': 'reauthenticate'
      },
      provider: firebase.auth.FacebookAuthProvider.PROVIDER_ID
    },
    firebase.auth.TwitterAuthProvider.PROVIDER_ID,
    firebase.auth.GithubAuthProvider.PROVIDER_ID,
    {
      requireDisplayName: false,
      provider: firebase.auth.EmailAuthProvider.PROVIDER_ID
    },
    firebase.auth.PhoneAuthProvider.PROVIDER_ID,
    firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
  ],
  tosUrl: '<your-tos-link>',
  privacyPolicyUrl: '<your-privacyPolicyUrl-link>',
  credentialHelper: firebaseui.auth.CredentialHelper.ACCOUNT_CHOOSER_COM
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
LennyZ71commented, Jun 7, 2019

@RaphaelJenni Getting this error now since angular 8.0.0. even with the exposed libraries.

npm.js:73 Uncaught TypeError: Cannot read property 'Promise' of undefined
    at da (npm.js:73)
    at npm.js:74
    at npm.js:425
    at Object../node_modules/firebaseui/dist/npm.js (npm.js:425)
    at __webpack_require__ (bootstrap:78)
    at Module../node_modules/firebaseui-angular/fesm2015/firebaseui-angular.js (firebaseui-angular.js:1)
    at __webpack_require__ (bootstrap:78)
    at Module../src/app/auth/auth.module.ts (app.module.ts:29)
    at __webpack_require__ (bootstrap:78)
    at Module../src/app/app.module.ts (app.component.ts:8)
3reactions
sgehrmancommented, Sep 11, 2018

Here’s the fix:

// currently there is a bug while building the app with --prod // - https://github.com/RaphaelJenni/FirebaseUI-Angular/issues/76 // the plugin exposes the two libraries as well. You can use those: import { FirebaseUIModule, firebase, firebaseui } from ‘firebaseui-angular’;

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to resolve Firebase could not find firebase-auth-icense ...
Tried fixing it with many things like updating sdk build tools, google play services etc but still getting same error. Following is my...
Read more >
Module not found: Can't resolve 'firebase' | bobbyhadz
To solve the error "Module not found: Error: Can't resolve 'firebase'", make sure to install the firebase package by opening your terminal in...
Read more >
Release Notes | Firebase - Google
The Firebase SDK for Unity (v8.10.1) is now available. This release fixes an issue when building with mainTemplate.gradle.
Read more >
The Ultimate Guide To Firebase With Next.JS - Jarrod Watts
Learn How To Set Up Firebase With Next JS And Create A Cloud Firestore Database, GitHub Authentication, and Firebase Cloud Functions in Next ......
Read more >
Easily Add Firebase Auth to React - YouTube
Let's add Firebase Auth to a React app (Next.js) to keep those unsavoury characters out! We will create a custom AuthProvider to track...
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