-1

Here is what the package structure looks. Server folder contains the flask code, the src folder contains react code.

I have a Flask server with a react app. When I run the npm build script, it builds the 'build' folder. When flask attempts to render the html for my react app, I get the error for the Unexpected token '<' for 2.ed52de7f.chunk.js. It seems rather simple, but I have been stuck on this for a while and I desperately need help. The app renders fine when I open it using 'npm run start'.

1 Answers1

1

Unexpected token '<' for 2.ed52de7f.chunk.js

This means the request to get the static js file returns a HTML instead of javascript. You can do following things:

  • Check the url of chunk.js again, make sure it point to correct server
  • Trying to request that js with its url you will figure out the error

Hope this help

goooooooo
  • 90
  • 1
  • 5