firebaseui-web: Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase')

[REQUIRED] Describe your environment

  • Operating System version: WSL2 Ubuntu_
  • Browser version: Chrome 86.0.4240___
  • Firebase UI version: 4.7.0_
  • Firebase SDK version: 8.0.0___

[REQUIRED] Describe the problem

Attempted import error: ‘app’ is not exported from ‘firebase/app’ (imported as ‘firebase’)

`According to the update log of the firebase SDK (version 8.0.0), the way to import firebase SDK should be`
import firebase from 'firebase/app' 
`instead of `
import * as firebase from 'firebase/app'

Steps to reproduce:

found when importing this package.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 27
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

[REQUIRED] Describe your environment

  • Operating System version: WSL2 Ubuntu_
  • Browser version: Chrome 86.0.4240___
  • Firebase UI version: 4.7.0_
  • Firebase SDK version: 8.0.0___

[REQUIRED] Describe the problem

Attempted import error: ‘app’ is not exported from ‘firebase/app’ (imported as ‘firebase’)

`According to the update log of the firebase SDK (version 8.0.0), the way to import firebase SDK should be`
import firebase from 'firebase/app' 
`instead of `
import * as firebase from 'firebase/app'

Steps to reproduce:

found when importing this package.

import firebase from "firebase/app";
import "firebase/performance";
import "firebase/firestore";
import "firebase/auth";

const fireConfig = {
   ....
};

if (!firebase.apps.length) {
  firebase.initializeApp(fireConfig);
}

export const perf = firebase.performance();
export const auth = firebase.auth();
export const db = firebase.firestore();
export default firebase;

I did the same thing as mentioned, but no change same error received. ./src/App.js Attempted import error: 'auth' is not exported from 'firebase'.

firebase --version 9.8.0 firebase tools --version 9.8…0

can you help me pls.

Error de importación intentado: ‘auth’ no se exporta desde ‘firebase’ ayuda por favor

First of all I am new but I had the same error, reading a little documentation from the firebase v8 is no longer used

import * as firebase from “firebase/app”; import “firebase/auth”;

Currently fix the error with the following Sorry for my English;

image

For Version 9 above ,

use this : (New Version)

import firebase from 'firebase/compat/app';
import "firebase/compat/firestore";

instead of this: (Old Version)

import firebase from 'firebase/app';
import "firebase/firestore";

This should be now fixed in 4.7.1. Please let us know if you have any issues with this.

This was a breaking change in the firebase-js-sdk. The fix will be released next week. For now, if you are using firebaseui, you may need to stick with a version older than 8.0.0.

Same error on Vue cli … How can Fix It…

Hi, can i ask you how to put 2 search results boxes in the same component??

Its for a marketplace. I want to see products and shops in those boxes. My <ais-instantsearch [config]=“config”> is the same fort both, the only difference i set to distinguish them is setting the distinct parameter to true or false in the config box:

<ais-configure *ngIf=“query.length <= 0” [searchParameters]=“{ hitsPerPage: 50, distinct: true, index: ‘posts’ }”

</ais-configure>

But that work when i have a TAB, thaht hides or show different searches but i dont know how to do that in the same component.

Thanks

I am attaching you an image of what i nedd to do.

Thanks

El vie, 4 jun 2021 a las 7:40, Abhishek Patel @.***>) escribió:

[REQUIRED] Describe your environment

  • Operating System version: WSL2 Ubuntu_
  • Browser version: Chrome 86.0.4240___
  • Firebase UI version: 4.7.0_
  • Firebase SDK version: 8.0.0___

[REQUIRED] Describe the problem

Attempted import error: ‘app’ is not exported from ‘firebase/app’ (imported as ‘firebase’)

According to the update log of the firebase SDK (version 8.0.0), the way to import firebase SDK should beimport firebase from ‘firebase/app’ instead of import * as firebase from ‘firebase/app’

Steps to reproduce:

found when importing this package.

import firebase from “firebase/app”;import “firebase/performance”;import “firebase/firestore”;import “firebase/auth”; const fireConfig = { …}; if (!firebase.apps.length) { firebase.initializeApp(fireConfig);} export const perf = firebase.performance();export const auth = firebase.auth();export const db = firebase.firestore();export default firebase;

I did the same thing as mentioned, but no change same error received. ./src/App.js Attempted import error: ‘auth’ is not exported from ‘firebase’. firebase --version 9.8.0 firebase tools --version 9.8…0 can you help me pls.

Did you solved it? I am having the same issue

Yes I change the version of firebase to little bit older and it will work very well for me. “firebase”: “^7.24.0”, If you change your firebase version with above then it will works.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/firebase/firebaseui-web/issues/771#issuecomment-854608054, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP2DH2Z3TULBNZOGCPGSFFTTRCUSLANCNFSM4TBTZR4A .

[REQUIRED] Describe your environment

  • Operating System version: WSL2 Ubuntu_
  • Browser version: Chrome 86.0.4240___
  • Firebase UI version: 4.7.0_
  • Firebase SDK version: 8.0.0___

[REQUIRED] Describe the problem

Attempted import error: ‘app’ is not exported from ‘firebase/app’ (imported as ‘firebase’)

`According to the update log of the firebase SDK (version 8.0.0), the way to import firebase SDK should be`
import firebase from 'firebase/app' 
`instead of `
import * as firebase from 'firebase/app'

Steps to reproduce:

found when importing this package.

import firebase from "firebase/app";
import "firebase/performance";
import "firebase/firestore";
import "firebase/auth";

const fireConfig = {
   ....
};

if (!firebase.apps.length) {
  firebase.initializeApp(fireConfig);
}

export const perf = firebase.performance();
export const auth = firebase.auth();
export const db = firebase.firestore();
export default firebase;

I did the same thing as mentioned, but no change same error received. ./src/App.js Attempted import error: 'auth' is not exported from 'firebase'. firebase --version 9.8.0 firebase tools --version 9.8…0 can you help me pls.

Did you solved it? I am having the same issue

Yes I change the version of firebase to little bit older and it will work very well for me. "firebase": "^7.24.0", If you change your firebase version with above then it will works.