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

340
Views
TypeError: _services_login__WEBPACK_IMPORTED_MODULE_0__.login no es una función

¿Alguien puede ver qué está mal aquí? Empecé a crear una aplicación y me quedé atascado al principio...

Obteniendo este error al activar loginToSpotify() :

 TypeError: _services_login__WEBPACK_IMPORTED_MODULE_0__.login is not a function at loginToSpotify (Login.js:6:1) at onClick (Login.js:15:1) at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1) at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1) at invokeGuardedCallback (react-dom.development.js:4277:1) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4291:1) at executeDispatch (react-dom.development.js:9041:1) at processDispatchQueueItemsInOrder (react-dom.development.js:9073:1) at processDispatchQueue (react-dom.development.js:9086:1) at dispatchEventsForPlugins (react-dom.development.js:9097:1)

índice.js

 import ReactDOM from 'react-dom/client' import App from './App' ReactDOM.createRoot(document.getElementById('root')).render(<App />)

Aplicación.js

 import Login from './pages/Login' const App = () => { return ( <> <Login /> </> ) } export default App

Iniciar sesión.js

 import loginService from '../services/login' const Login = () => { const loginToSpotify = async () => { try { const response = await loginService.login() } catch (err) { console.log(err) } } return ( <> <div> <button onClick={() => loginToSpotify()}>Login using Spotify</button> </div> </> ) } export default Login

iniciar sesión.js

 import axios from 'axios' const login = async () => { const response = await axios.post('/login') return response.data } export default { login }

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
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!