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

144
Vistas
Why does it show Uncaught SyntaxError: Unexpected token '<' (at index.js:5:5) in the live server

After rendering the code below, the console of the live server shows the following error "Uncaught SyntaxError: Unexpected token '<' (at index.js:5:5)"

    import React from "react"
    import ReactDOM from "react-dom"
    
    const page=(
    <div>
    <h1>My awesome website in React</h1>
    <h2>Reasons I love React</h2>
    <ol>
        <li>Its composable</li>
        <li>Its declarative</li>
        <li>Its a hireable skill</li>
        <li>Activley maintained by skilled people</li>
    </ol>
    </div>
    )

    ReactDOM.render(page,document.getElementById("root"))
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The JSX is causing the issue.

Assuming you’re using live server in VSCode, live server has no concept of JSX; it doesn’t transpile, and it can’t read. You need to use webpack, rollup, etc.

create-react-app and vite are the most commonly used tools for this. Otherwise, you’d have to set up all the transpiling with babel or the aforementioned tools on your own.

Remember, JSX isn’t valid JS, HTML, etc.

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