Quiero cambiar esto debajo del código Firebase V8 a Firebase V9 :
Intenté de muchas maneras pero muestra error.
Cambie este código a la versión 9
ver el código completo: https://github.com/SimCoderYoutube/InstagramClone/blob/master/frontend/components/main/Save.js
import firebase from 'firebase/compat/app'; require("firebase/firestore") require("firebase/firebase-storage") const uploadImage = async () => { const uri = props.route.params.image; const childPath = `post/${firebase.auth().currentUser.uid}/${Math.random().toString(36)}`; console.log(childPath); const response = await fetch(uri); const blob = await response.blob(); const task = firebase.storage() .ref() .child(childPath) .put(blob); const taskProgress = snapshot => { console.log(`transferred: ${snapshot.bytesTransferred}`) } const taskCompleted = () => { task.snapshot.ref.getDownloadURL().then((snapshot) => { savePostData(snapshot); console.log(snapshot) }) } const taskError = snapshot => { console.log(snapshot) } task.on("state_changed", taskProgress, taskError, taskCompleted); }Los módulos de nodo están instalados correctamente. Pero muestra Error:
./node_modules/firebase/firebase-storage.js:1 Module not found: Can't resolve 'https://www.gstatic.com/firebasejs/9.5.0/firebase-app.js' > 1 | import { getApp, _getProvider, _registerComponent, registerVersion, SDK_VERSION } from 'https://www.gstatic.com/firebasejs/9.5.0/firebase-app.js'; 2 | 3 | /** 4 | * @license