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

145
Views
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 answers
Answer question

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 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!