3

We have this web app that is built using create-react-app and was deployed. Now we get this error in our console.

Uncaught SyntaxError: Unexpected token '<'

Most of the answers on StackOverflow speaks of webpack and all. We aren't using a webpack.

What can be the reason for this? How do we fix this?

SuleymanSah
  • 17,153
  • 5
  • 33
  • 54
kolaveri
  • 59
  • 1
  • 2
  • 15

1 Answers1

4

Your server cannot find the .js file, and your web server is returning either a 404 page or the default index.html. That's why it says 'unexpected token <', from the <DOCTYPE tag. You should see what the response is in your network tab from the main.chunk.js, and also verify if it's loading from the correct location

Poul Kruijt
  • 69,713
  • 12
  • 145
  • 149