There is a problem with the operation of React after packaging.

I can run before packaging without any error reports. This problem occurs after packaging.
reports such an error in the browser, using scaffolding made by create-react-app, and the back end is Node.js, backend. No error is reported:
packages two different applications with such errors

Uncaught SyntaxError: Unexpected token <

I found out that the reason is that Express parses the HTML file as JS, so what should I do?


changing publicPath in outPut in webpack configuration to absolute path'/ 'should be fine


I also encountered the same problem. Have you solved it

?
Menu