'ERROR in ./src/App.js 19:4-17 export 'db' (imported as 'db') was not found in './firebase' (possible exports: default)

ERROR in ./src/App.js 19:4-17 export 'db' (imported as 'db') was not found in './firebase' (possible exports: default)
@ ./src/index.js 7:0-24 11:33-36

webpack 5.68.0 compiled with 1 error in 427 ms



Solution 1:[1]

Firebase has some updates in their latest version just follow this bug will be resolved

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

const firebaseConfig = {
        apiKey: "AIzaSyBWWTtB1mBrrP**********",
        authDomain: "todo-app-cp-****.firebaseapp.com",
        projectId: "todo-app-cp-****",
        storageBucket: "todo-app-cp-****.appspot.com",
        messagingSenderId: "****************",
        appId: "1:********:web:******",
        measurementId: "G-*******"
  };

  const firebaseApp = firebase.initializeApp(firebaseConfig);
  const db = firebaseApp.firestore();
 
  export {db};

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 glinda93