From 0d10e3b947eb16a308ddffd5369c0d2d337d9ece Mon Sep 17 00:00:00 2001 From: Brandon Konkle Date: Tue, 14 Aug 2018 18:42:31 -0600 Subject: [PATCH] Use the correct port when PORT is not set --- packages/razzle-dev-utils/webpackHotDevClient.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/razzle-dev-utils/webpackHotDevClient.js b/packages/razzle-dev-utils/webpackHotDevClient.js index 6e5d889f9..8334fd167 100644 --- a/packages/razzle-dev-utils/webpackHotDevClient.js +++ b/packages/razzle-dev-utils/webpackHotDevClient.js @@ -27,7 +27,7 @@ ErrorOverlay.startReportingRuntimeErrors({ launchEditorEndpoint: url.format({ protocol: window.location.protocol, hostname: window.location.hostname, - port: parseInt(process.env.PORT, 10) + 1 || window.location.port, + port: parseInt(process.env.PORT || window.location.port, 10) + 1, pathname: launchEditorEndpoint, }), onError: function() { @@ -48,7 +48,7 @@ var connection = new SockJS( url.format({ protocol: window.location.protocol, hostname: window.location.hostname, - port: parseInt(process.env.PORT, 10) + 1 || window.location.port, + port: parseInt(process.env.PORT || window.location.port, 10) + 1, // Hardcoded in WebpackDevServer pathname: '/sockjs-node', })