Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

341
Vistas
Error @signUp: [TypeError: undefined is not an object (evaluating 'firebase.createUser')]

I'm trying to implement my signUp screen here is the signup handle that is being called, the signup page calls, and pass in the value to my context page.

const handleSignup = async () => {
    setLoading(true)

      const user = { fullname, email, password, profilePhoto};

    try {

      const createdUser = await firebase.createUser(user)

      setUser({ ...createdUser, isLoggedIn: true });
    } catch (error) {

      console.log("Error @signUp: ", error);

    } finally {

      setLoading(false)

    }
  };

the firebaseContext page then takes in the value that has been passed in creates the account

    const FirebaseContext = createContext();
    
    if(!firebase.apps.length){
        firebase.initializeApp(auth);
    }
    
    const db = firebase.firestore();
    
    const Firebase = {
        getCurrentUser: () => {
            return firebase.auth().currentUser
        },
    
        createUser: async (user) => {
            try{
                 await firebase.auth().createUserWithEmailAndPassword(user.email, user.password);
                 const uid = Firebase.getCurrentUser().uid;
    
                 let profilePhotoUrl = "default";
    
                 await db.collection("users").doc(uid).set({
                     fullname: user.fullname,
                     email: user.email, 
                     profilePhotoUrl
                 })
    
                 if(user.profilePhoto){
                    profilePhotoUrl = await Firebase.uploadProfilePhoto(user.profilePhoto);
                 }
    
                 delete user.password;
    
                 return { ...user, profilePhotoUrl, uid};
    
            }catch(error){
                console.log("Error @createUser", error.message);
            }
        },

Exporting the file

import { FirebaseContext, FirebaseProvider, Firebase } from './FirebaseContext';
import { UserContext, UserProvider } from './UserContext';


export { FirebaseContext, Firebase, FirebaseProvider, UserContext, UserProvider };

Importing the file

import { FirebaseContext } from "../context";
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda