Node JS and Webpack Unexpected token <

前端 未结 5 856
旧巷少年郎
旧巷少年郎 2020-12-01 05:41

I\'ve started studing Node JS.

So here is my files.

index.html





        
5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 06:13

    No matter what is requested by the browser, your server will always return the same exact file: index.html.

    The error you are seeing is because your HTML file has a reference to bundle.js, which, when requested, is returned with the contents of index.html.

    You should use a web framework so that you don't have to worry about these things. E.g. Express.

提交回复
热议问题