404 because of restarting the webpack-dev-server

后端 未结 1 500
我寻月下人不归
我寻月下人不归 2021-02-13 16:23

I\'m getting this in my developer tools when I try change my react component and save it to see if hot loader updated my page:

GET http://localhost:3000/public/b         


        
相关标签:
1条回答
  • 2021-02-13 16:29

    Instead of using

    entry: [
        './app/index.js'
    ],
    

    as your entry

    add two additional entries along with it like this:

    entry: [
        'webpack-dev-server/client?http://localhost:3000', // WebpackDevServer host and port
        'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors
        './app/index.js' // Your appʼs entry point
    ]
    
    0 讨论(0)
提交回复
热议问题