Home > Back-end >  When I import firebase from "firebase", error can't resolve firebase occurs
When I import firebase from "firebase", error can't resolve firebase occurs

Time:10-08

I am building a login and registration. I have a firebase.js file in src folder, and have done npm i firebase I then wrote import firebase from 'firebase'; and now i have an error that says Module not found: Can't resolve 'firebase' in '/Users/al/Desktop/amazon_clone_sep2021/amazon-clone/src'

Can anyone help me? I am following a tutorial and i am 3 hours in. This is my first big error i have encounteredenter image description here

CodePudding user response:

You have to update your import statement to

import firebase from 'firebase/app'

as advised in official firebase docs here

CodePudding user response:

You must do

import firebase from "firebase/app";

for the import to work now.

I believe

import firebase from "firebase";

was the old way to do it but will no longer works

  • Related