Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
Rechazo no controlado (TypeError): firebase_app__WEBPACK_IMPORTED_MODULE_18__.default.auth(...).updateProfile no es una función

Así que hice un selector de avatar y ahora recibo este error si selecciono una imagen.

También debería mostrar la imagen en el avatar, pero en su lugar me está dando el error.

¿Cómo puedo resolver esto y administrarlo para mostrar la imagen en el icono de Avatar?

Mi código:

 async function handleFileInputChange(e) { const files = e.target.files; const file = files[0]; const storage = firebase.storage(); const usersImageRef = storage .ref() .child(`users/${user.uid}/profilepicture.jpg`); const snap = await usersImageRef.put(file); const donwloadURL = await snap.ref.getDownloadURL(); setDownloadURL(donwloadURL); await firebase.auth().updateProfile({ photoURL: donwloadURL }); } <input accept="image/*" className={classes.input} id="contained-button-file" multiple type="file" onChange={handleFileInputChange} /> <label> <IconButton> <Avatar src="../assets/ana.png" style={{ margin: "10px", width: "60px", height: "60px", }} /> </IconButton> </label>

El error :

ingrese la descripción de la imagen aquí

Esto es lo que parece :

ingrese la descripción de la imagen aquí

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El método updateProfile existe en el objeto User y no en la instancia de autenticación de Firebase. Intenta refactorizar la función de esta manera:

 const user = firebase.auth().currentUser // <-- .currentUser if (user) { await user.updateProfile({ photoURL: donwloadURL }); } else { console.log("No user logged in!") }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!