hot-update.json 404 (Not Found)

See original GitHub issue

Reproducible test repos:

Shortly: publichPath in webpack-dev-server doesn’t override publisPath in webpack

Need search way how better handle publicPath


https://github.com/webpack/webpack-dev-server/issues/1591#issuecomment-468081433

https://github.com/webpack/webpack-dev-server/issues/1591#issuecomment-448995873

  • Operating System: El Capitan 10.11.6
  • Node Version: 8.9.3
  • NPM Version: 5.5.1
  • webpack Version: 4.6.0
  • webpack-dev-server Version: 3.1.3
  • This is a bug
  • This is a modification request

Code

const path = require('path');
const fs = require("fs");
const dir = d => path.join(process.cwd(), d);

module.exports = {
  entry: {
    application: './src/application',
    test: './src/test'
  },
  output: {
    path: dir('../public/assets/client'),
    filename: "[name].bundle.js"
  },
  devServer: {
    stats: 'errors-only',
    https: true,
    key: './path_to_pemfile.pem',
    cert: './path_to_pemfile.pem',
    headers: {
      'Access-Control-Allow-Origin': '*'
    },
    port: 9092,
    host: 'broker-gateway-webpack.firstbanco.dev'
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: "babel-loader"
        }
      }
    ]
  }
};



"scripts": {
    "start": "webpack-dev-server --hot --mode development"
}

Expected Behavior

I would expect HMR to work.

Actual Behavior

When I save a change in a js file a request is made for application.bundle.js:33 GET https://broker-gateway.firstbanco.dev/1a00a5ecc216afcb2106.hot-update.json 404 (Not Found).

As you can see the correct port number has not been specified for the requested resource.

If I manually execute a GET request to https://brokergateway.firstbanco.dev:9092/1a00a5ecc216afcb2106.hot-update.json (note I have added correct port) then I get the resource fine.

For Bugs; How can we reproduce the behavior?

As explained… use above webpack config and change a js file under application or test entry points.

For Features; What is the motivation and/or use-case for the feature?

Ease of development.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:20
  • Comments:40 (13 by maintainers)

github_iconTop GitHub Comments

38reactions
alexander-akaitcommented, May 16, 2018

PR welcome

29reactions
hiroppycommented, Jun 17, 2019

@josh08h how about this?

const path = require('path')

module.exports = {
  mode: 'development',
  entry: path.join(__dirname, 'bundle.js'),
+ output: {
+   publicPath: 'http://0.0.0.0:9000/dist/',
+ },
  devServer: {
    contentBase: __dirname,
-   publicPath: '/dist/',
    compress: true,
    port: 9000,
    hotOnly: true,
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
  }
}

We have to change the port which provides hot-update from 8080 to 9000 even if we access localhost:8080.

Read more comments on GitHub >

github_iconTop Results From Across the Web

hot-update.json 404 (Not Found) triggered randomly when ...
json 404 (Not Found) . This error will loop infinitely and the only way to temporarily solve the issue is to refresh the...
Read more >
gaearon/react-hot-loader - Gitter
Hiya. I initially meant to come here because I had problems with 404's on the hot-update.json files. However, now I can't even get...
Read more >
next.js hot-update.json 404 error - OKKY
next.js hot-update.json 404 error. 안녕하세요 넥스트와 리액트로 프로젝트 작업하고 있는 프론트 개발자 입니다. 로컬 작업환경은 도커로 작업하고 ...
Read more >
XMLHttpRequest cannot load hot-update.json due to access ...
Seems as though the initial page load works with Sage but when Browsersync reloads the page, nothing changes. I noticed these errors in...
Read more >
webpack5 hot-update.json 404 - 掘金
webpack5 hot-update.json 404技术、学习、经验文章掘金开发者社区搜索结果。掘金是一个帮助开发者成长的社区,webpack5 hot-update.json 404技术文章由稀土上聚集的 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found