Skip to content

Commit 3c5fff0

Browse files
caryliskipjack
authored andcommitted
docs(guides): update wds options in hot-module-replacement (#1617)
Define the host property of the options object and set it to 'localhost'. The webpack-dev-server CLI defaults the host to 'localhost', but `addDevServerEntrypoints` from the webpack-dev-server Node.js API does not set a default and leaves it undefined, which will eventually throw "Uncaught SyntaxError: The URL 'http:/sockjs-node' is invalid" in the browser when following the code example. webpack/webpack-dev-server#1129
1 parent 017e558 commit 3c5fff0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/content/guides/hot-module-replacement.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ const webpack = require('webpack');
145145
const config = require('./webpack.config.js');
146146
const options = {
147147
contentBase: './dist',
148-
hot: true
148+
hot: true,
149+
host: 'localhost'
149150
};
150151

151152
webpackDevServer.addDevServerEntrypoints(config, options);

0 commit comments

Comments
 (0)