Create-React-App build - “Uncaught SyntaxError: Unexpected token <”

后端 未结 9 1454
予麋鹿
予麋鹿 2020-12-10 10:35

I realize this question has been asked multiple times but nothing has worked for me...

I\'m trying to create a static build of a create-react-app projec

9条回答
  •  情书的邮戳
    2020-12-10 11:06

    Thanks this helped me a lot. Just wanting to add to this with an example from a Create-React-App project that had the same solution: I received the same error after deploying to heroku.

    Uncaught SyntaxError: Unexpected token < after serve -s build

    For me the problem was in the packages.json file. The "homepage" parameter i gave was incorrect. Changing this to the correct heroku URL solved the issue.

    "homepage": "https://myapp.herokuapp.com/"
    

    Hope this addition is helpful.

提交回复
热议问题