Languages

React - firebase import error

0 points
Asked by:
christa
600

I have a problem with importing firebase into React.

I was trying to import the Firebase like this but it didn't work:

I got the following error:

Then I change the imports like this:

and now I have this error:

I've done everything from the youtube tutorial but it didn't work for me. I've installed the firebase in my project using npm install firebase, checked directory like million times, even tried installing it locally with npm install --save firebase or changing import into require(), didn't work.

What is the right way to import Firebase in React?

1 answer
0 points
Answered by:
Admin Dirask Community
4380

There were some updates on firebase, that's why you can't import it like this.

Instead of:

Use this:

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join