Looking for hot-update.json files in the wrong place

See original GitHub issue

I’m using a virtual machine to serve my webpack-dev-server and everything seems to be working just great except that the webpack-dev-server.js script trys to fetch my hot-update.json using my window.location.hostname, Rather than the ip address everything else is loaded from.

GET http://mysite.dev/b3ed7794aa51bd32ab93.hot-update.json 404 (Not Found)hotDownloadManifest @ bundle.js:26hotCheck @ bundle.js:224check @ dev-server.js:12(anonymous function) @ dev-server.js:56
dev-server.js:28 [HMR] Cannot find update. Need to do a full reload!
dev-server.js:29 [HMR] (Probably because of restarting the webpack-dev-server)
client:31 [WDS] Nothing changed.

When I check the virtual machine ip/port the hot update is there. http://192.168.56.10:8080/0.e71cbe1b6f2760378f0d.hot-update.js

How can I tell webpack to look for the hot update files at this location?

I’m embedding this script into my nginx served html page

<script src="http://192.168.56.10:8080/bundle.js"></script>

here is my webpack-dev-server.js config file.

var webpack = require("webpack");
var webpackConfig = require("../webpack.config.js");
module.exports = {
    options: {
        webpack: webpackConfig,
        publicPath: "/",
    },
    default: {
        output: {
            publicPath: "http://192.168.56.10:8080/",
        },
        webpack: {
            devtool: "eval",
            debug: true,
        },
        host: "192.168.56.10",
        hot: true,
        inline: true,
        keepalive: true,
        watchOptions: {
            poll: 1000,
        },
    }
};


And in case its needed my webpack.config.js

var path = require("path");
var webpack = require("webpack");
module.exports = {
    cache: true,
    entry: {
        App: [
            path.join(__dirname, "assets/js/app.js"),
        ],
    },
    devtool: "cheap-module-source-map",
    output: {
        path: path.join(__dirname, "public/js"),
        filename: "bundle.js",
        sourceMapFilename: "[file].map",
    },
    module: {
        loaders: [
            {
                test: /\.scss$/,
                loaders: ["style", "raw", "sass"]
            },
            {
                test: /\.jsx?$/,
                exclude: /(node_modules)/,
                loader: "babel",
                query: {
                    plugins: ["transform-runtime"],
                    presets: ["es2015"],
                },
            },
        ],
    },
    resolve: {
        modulesDirectories: [
            "node_modules",
            "assets/js",
        ],
    },
    plugins: [],
};

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9

github_iconTop GitHub Comments

3reactions
Hatimtechcommented, Aug 9, 2019

__webpack_public_path__ = "http://webpack:8080/" doesn’t do anything for me.

It worked after changing webpack to localhost

3reactions
Jmeyeringcommented, Feb 21, 2016

I was able to solve this by setting

 __webpack_public_path__ = "http://webpack:8080/";

In my entrypoint.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack hot-reload set correctly in publicPath, but hot ...
But it tries to look up the hot-update file in wrong place ! It uses the current url, and not "/static". If my...
Read more >
JSON in PostgreSQL: The Ultimate Guide - Database Star
How to add, read, update, and delete JSON data; Tips for performance, validating and working with JSON. Let's get into the guide. If...
Read more >
How to ask for each field for update in json file. - CodeProject
Solution 1. Accept Solution Reject Solution. The section in your update code looks incorrect, you have: Python.
Read more >
How to replace a value in json file using jq and returning the ...
If the key needs to be base64 encoded, update with the value ($newkey|@base64) in place of just $newkey in the jq expression. To...
Read more >
How to read and update JSON files with Node.js [16 of 26]
JSON is a file format particularly useful for storing data in Node.js applications. Learn how to read and modify JSON files while taking ......
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