I was able to use firebase.storage() in React (firebase7.20.0), but even though I wrote the same code in Next.js, I got an error message for firebase.storage is not a function.
What is the cause?
firebase 7.23.0
import firebase from "firebase";
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
constfirebaseConfig={
// config
};
constfirebaseApp=!firebase.apps.length
? firebase.initializeApp(firebaseConfig)
: firebase.app();
const db = firebaseApp.firestore();
const auth = firebase.auth();
const provider = new firebase.auth.GoogleAuthProvider();
const storage=firebaseApp.storage()
export {auth, provider, storage};
export default db;
import "firebase/storage";
I think it's because I don't have this one.
© 2024 OneMinuteCode. All rights reserved.