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

212
Views
¿Cómo resolver const auth no definido?

quiero usar la autenticación de base de fuego, así que declaré una autenticación con nombre constante en mi script de cuerpo html y quería usarla en mi archivo auth.js pero dice que no está definido y quiero saber cómo resolver el problema. este es el código que escribí: este es el código en mi archivo html:

 <!-- Firebase --> <script type="module"> // Import the functions you need from the SDKs you need import { initializeApp } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-app.js"; import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-analytics.js"; import { getAuth, createUserWithEmailAndPassword } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-auth.js"; import { getFirestore } from "https://www.gstatic.com/firebasejs/9.0.2/firebase-firestore.js"; // TODO: Add SDKs for Firebase products that you want to use // Your web app's Firebase configuration // For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyC3GLIN5TBmCDoTfy0dEOgOdvVvqNw-ric", authDomain: "auth-project-38aaa.firebaseapp.com", projectId: "auth-project-38aaa", storageBucket: "auth-project-38aaa.appspot.com", messagingSenderId: "431888894254", appId: "1:431888894254:web:71bb9b250fbb8a21edd2bf", measurementId: "G-6BBPCJ3814" }; // Initialize Firebase const app = initializeApp(firebaseConfig); const analytics = getAnalytics(app); const auth = getAuth(app); const db = getFirestore(app); </script> <!-- JS --> <script src="vendor/jquery/jquery.min.js"></script> <script src="js/auth.js"></script>

y este es el código en mi auth.js:

 const signUpForm = document.querySelector('#register-form'); signUpForm.addEventListener('submit', (e) => { e.preventDefault(); // get user info const name = signUpForm['name'].value; const email = signUpForm['email'].value; const pass = signUpForm['pass'].value; const rePass = signUpForm['re_pass'].value; const agreeTerm = signUpForm['agree-term'].value; console.log(name, email, pass, rePass, agreeTerm); // sign up the user auth.createUserWithEmailAndPassword(email, pass).then(cred => { console.log(cred); }); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

El auth.createUserWithEmailAndPassword es para Firebase SDK v8 y anterior, o para el modo de compatibilidad en v9.

La nueva sintaxis está de acuerdo con la documentación sobre la creación de un usuario :

 createUserWithEmailAndPassword(auth, email, pass).then(cred => { ... });
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!