Uncaught SyntaxError: Unexpected token '<' in main.546ac9e6.chunk.js:1 [closed]

天大地大妈咪最大 提交于 2021-02-10 05:27:21

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!