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

290
Views
La compilación del módulo falló (desde ./node_modules/babel-loader/lib/index.js)

Tengo este código en mi App.js:

 import React, {useEffect, useState} from 'react' function App() { const [backendData, setBackendData] = useState([{}]) useEffect(() => { fetch("/api").then(response => response.json()).then( data => { setBackendData(data) } ) }, []) return ( <div> {(typeof backendData.users === 'undefined') ? ( <p>Loading...</p> ): ( backendData.users.map(user, i) => ( <p key={i}> {user} </p> )) )} </div> ) } export default App

Y sigo recibiendo este error:

ERROR en ./src/App.js

Falló la compilación del módulo (de ./node_modules/babel-loader/lib/index.js): SyntaxError: E:\Interconnect\client\src\App.js: Token inesperado, esperado "," (19:39)

LA LINEA 19 es esta:

 backendData.users.map(user, i) => (
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

La sintaxis correcta es

 backendData.users.map((user, i) => ( <p key={i}> {user} </p> ))

con un par de paréntesis alrededor de la función (user, i) => (...) .

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