Home > other >  ReactJS/JS/Firebase - Image Upload to Firebase Storage - ERRORS
ReactJS/JS/Firebase - Image Upload to Firebase Storage - ERRORS

Time:08-10

I have watched every tutorial and all done all the research possible, yet I keep getting errors for my code. An example error (this error keeps occurring for different part of the code) enter image description here

In the same file I import import firebase from 'firebase/compat/app' add then const storage = firebase.storage(), in a different file I also import import firebase, {initializeApp} from "firebase/compat/app"; import "firebase/compat/auth"; import "firebase/compat/firestore"; I also tried to import firebase/storage but I had the same problem. Any help would be nice, thank you in advance :)

CodePudding user response:

The syntax for the import firebase/storage should be like this:

import firebase from "firebase/compat/app";

// After you import app...
import "firebase/compat/storage";

You may refer to this documentation about compat libraries.

  • Related