0

I have an express server that setup a hot-update file at the address localhost:8080/static/xxx.hot-update.json. So far so good.

("/static" is the devServer’s publicPath.)

On the frontend side I have this line in my js : require("webpack-hot-middleware/client?reload=true")

But it tries to look up the hot-update file in wrong place ! It uses the current url, and not "/static". If my page is localhost:8080/foo, it’ll try to fetch localhost:8080/foo/xxx.hot-update.json which obviously fails.

If I try to add a path :require("webpack-hot-middleware/client?path=/static/&reload=true") I’ll have a 404 error : cannot find localhost:8080/static/

I know I’m missing a tiny parameter… but I can’t find what it can be

thanks a lot in advance for any help you can give :)

best !

Tumulte
  • 161
  • 1
  • 1
  • 8

1 Answers1

0

The missing bit was that I needed to add the same publicPathas everywhere else output:{}settings of webpack’s config

Tumulte
  • 161
  • 1
  • 1
  • 8