问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/58763819/uncaught-syntaxerror-unexpected-token-in-main-546ac9e6-chunk-js1