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

214
Views
React - TypeError no detectado: el constructor de clase Firebase no se puede invocar sin 'nuevo'

mientras usaba Firebase Auth en React, obtuve esto en la Consola:

 Uncaught TypeError: Class constructor Firebase cannot be invoked without 'new' at Recompose.esm.js:803:1 at Module../src/components/globalPages/SignUp/index.js (index.js:113:1) at Module.options.factory (react refresh:6:1) at __webpack_require__ (bootstrap:24:1) at fn (hot module replacement:61:1) at Module../src/constants/routes.js (index.js:119:1) at Module.options.factory (react refresh:6:1) at __webpack_require__ (bootstrap:24:1) at fn (hot module replacement:61:1) at Module../src/components/App/index.js (bundle.js:15:75)

Mi código:

 import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import reportWebVitals from './reportWebVitals'; import App from './components/App/index'; import Firebase, { FirebaseContext } from './components/Firebase'; ReactDOM.render( < React.StrictMode > < FirebaseContext.Provider value = { new Firebase() } > < App / > < /FirebaseContext.Provider> </React.StrictMode > , document.getElementById('root')); reportWebVitals(); class Firebase { constructor() { firebase.initializeApp(FirebaseConfig); } createUserWithEmailAndPassword = (email, password) => firebase.auth().createUserWithEmailAndPassword(email, password); signInWithEmailAndPassword = (email, password) => firebase.auth().signInWithEmailAndPassword(email, password); signOut = () => firebase.auth().signOut(); passwordReset = email => firebase.auth().sendPasswordResetEmail(email); passwordUpdate = password => firebase.auth().currentUser.updatePassword(password); }; export default Firebase;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

proveedor const = firebase.auth.GoogleAuthProvider();

El código anterior estaba dando error, Uncaught TypeError: el constructor de clase Firebase no se puede invocar sin 'nuevo', en mi caso,

así que esto es lo que hice

proveedor const = new firebase.auth.GoogleAuthProvider();

simplemente agregue la palabra clave "nueva". Funcionó para mí, espero que esto ayude

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!