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

146
Views
TypeError no capturado (en promesa): no se pueden leer las propiedades de undefined (leyendo 'mensaje') al hacer clic

Estoy creando un formulario de registro, y es necesario implementar la función de clic, cuando se hace clic, llamaremos a las funciones apropiadas: inicio de sesión o registro, pero un TypeError no detectado (en promesa): no se pueden leer las propiedades de indefinido (leyendo 'mensaje' ) al hacer clic se produce un error. ¿Cuál es el problema?

 const {user} = useContext(Context) const location = useLocation() const history = useHistory() const isLogin = location.pathname === LOGIN_ROUTE const [email, setEmail] = useState('') const [password, setPassword] = useState('') const click = async () => { try { let data; if (isLogin) { data = await login(email, password); } else { data = await registration(email, password); } user.setUser(user) user.setIsAuth(true) history.push(SHOP_ROUTE) } catch (e) { alert(e.response.data.message) } }

Aquí están las funciones de inicio de sesión, registro

 import {$authHost, $host} from "./index"; export const registration = async (email, password) => { const response = await $host.post('api/user/registration', {email, password, role: 'ADMIN'}); return response; } export const login = async (email, password) => { const response = await $host.post('api/user/login', {email, password}); return response; }

También aparece el error POST https://localhost:5000/api/user/registration net::ERR_CONNECTION_REFUSED

about 4 years ago · Juan Pablo Isaza
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!