4

When Webpack attempts to fetch the update JSON file, it fails with the console error message:

[HMR] Update failed: Error: Manifest request to https://subdomain.localhost23dae8e1865781c26fcd.hot-update.json timed out.

Note the omission of a slash between the TLD and the path…

Devserver config:

{
  public: `subdomain.localhost`,
  publicPath: 'https://subdomain.localhost/',
  port: 9000,
  https: false,
  contentBase: path.join(__dirname),
  watchContentBase: true,
  historyApiFallback: true,
  compress: true,
  hot: true
};

What configuration is required to ensure update manifest will load from the correct path?

Bin Ury
  • 645
  • 7
  • 20

2 Answers2

4

Surprisingly, the hot module replacement plugin will actually look to the config.output.publicPath property rather than the config.devServer.[static].publicPath value.

devServer.static.publicPath (or WDS < 4, devServer.publicPath) should be the same as output.publicPath.

Correcting the output property to use the full path https://subdomain.localhost/ corrects this problem.

Bin Ury
  • 645
  • 7
  • 20
2

I believe publicPath should be just / instead of the full path.

Maokai
  • 364
  • 1
  • 5
  • From the docs: "To teach webpack to make requests (for chunk loading or HMR) to the webpack-dev-server you need to provide a full URL in the output.publicPath option." See: https://github.com/webpack/docs/wiki/webpack-dev-server – Bin Ury Mar 14 '18 at 20:30
  • full url here means the absolute path, but not including the domain name. see for example the first code block in the link you attach here, `publicPath` is "/assets/", not "https://subdomain.localhost/assets/" – Maokai Mar 14 '18 at 20:34