hot-update.json 404 (Not Found)
See original GitHub issueReproducible 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:
- Created 5 years ago
- Reactions:20
- Comments:40 (13 by maintainers)
Top Related StackOverflow Question
PR welcome
@josh08h how about this?
We have to change the port which provides hot-update from 8080 to 9000 even if we access
localhost:8080.