Encountered a strange issue today. As I tried to import firebase, an error popped up:
./node_modules/firebaseui/dist/esm.js
Attempted import error: 'app' is not exported from 'firebase/app' (imported as 'firebase').
The setup of my project goes as follows: There is a parent folder containing a react client folder. Firebase was installed in the parent folder, and a firebase app was initialized in the firebaseConfig file within the parent folder, which was then imported into the react client folder.
At one point, I attempted installing firebase directly in the react client folder and importing it there. However, after installing firebase in the client folder, running "npm ls firebase" returned empty, despite firebase being present in the node modules and package.json within the client folder. This situation left me puzzled as to what might have caused this issue.
firebaseConfig.js in the parent folder
import firebase from 'firebase/app';
import 'firebase/firestore';
import 'firebase/auth';
const firebaseConfig = {
......
};
firebase.initializeApp(firebaseConfig);
export default firebase;