Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

368
Vistas
SyntaxError: Unexpected token, expected "," -- React w Typescript (.tsx)

I know several variations of this question have been asked. But, I haven't been able to find a solution for this particular case. Apologies in advance if I've overlooked something.

I'm getting the following error:

Unexpected token, expected "," (25:25)

function render( basename:string ) {
                         ^

Here's the function that is being pointed to in index.tsx:

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

One thing to note, the red error line doesn't show up in the code. It just breaks with the above error when trying to serve my UI container. I'm using webpack to serve using a few plugins in my webpack.config.js. I have typescript installed. I'm wondering if this is a linter error?

Here's the local tsconfig.json

{
  "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"]
}

... which extends

{
  "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
  }

edit: .eslintrc.json

{
  "env": {
    "node": true,
    "cypress/globals": true
  },
  "extends": ["plugin:cypress/recommended"],
  "plugins": ["cypress"]
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda