Search code examples
webpackelectronwebpack-hmr

Electron + webpack + HMR net::ERR_FILE_NOT_FOUND


Context

I try to make a small app using Electron / Webpack / React. I'm at the beginning of my project - the dev setup. So forget React for now.

Problem

I can't make the webpack hot reload working with electron. It is triggering, but no changes are made.

Details

I get this error (from the devTools console) when hot reload is triggering : GET file:///.../static/19a4692a1230e5770d9e.hot-update.json net::ERR_FILE_NOT_FOUND. I got this error only in Electron, but from a simple web page (Chrome) hot reload works well with no errors. Here my repo git. To reproduce, launch yarn watch and yarn start in two consoles and try to modify src/app.js.

Thx for you help !


Solution

  • I had to specify in the output part of my webpack config. I set the key publicPath with the value http://localhost:8080/ and it worked.