'Webpack (4) hot module reloading fetches update manifest from malformed URI

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?



Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Maokai