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

387
Views
SyntaxError: Token inesperado, esperado "," -- React w Typescript (.tsx)

Sé que se han hecho varias variaciones de esta pregunta. Pero, no he podido encontrar una solución para este caso particular. Disculpas de antemano si he pasado por alto algo.

Recibo el siguiente error:

 Unexpected token, expected "," (25:25) function render( basename:string ) { ^

Aquí está la función a la que se apunta en index.tsx :

 function render( basename:string ) { ReactDOM.render( <StrictMode> <Router basename={basename}> ... </Router> </StrictMode>, document.getElementById(target), ); };

Una cosa a tener en cuenta, la línea de error roja no aparece en el código. Simplemente se rompe con el error anterior al intentar servir mi contenedor de interfaz de usuario. Estoy usando webpack para servir usando algunos complementos en mi webpack.config.js . Tengo mecanografiado instalado. Me pregunto si esto es un error de linter.

Aquí está el tsconfig.json local

 { "extends": "../../tsconfig.json", "compilerOptions": { "target": "es2020", "jsx": "react-jsx", "types": ["jest", "cypress", "@testing-library/cypress", "@testing-library/jest-dom"] }, "include": ["src", "test", "webpack.config.js", "jest.config.js", "babel.config.js"] }

... que se extiende

 { "compilerOptions": { "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strict": false, "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, "noEmit": true }

editar: .eslintrc.json

 { "env": { "node": true, "cypress/globals": true }, "extends": ["plugin:cypress/recommended"], "plugins": ["cypress"] }
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!