From 32459c61993edb6ee57b5088941d968b81f9c484 Mon Sep 17 00:00:00 2001 From: Erin Schnabel Date: Fri, 10 Mar 2023 08:21:10 -0500 Subject: [PATCH] You need the host & port for vite hmr websocket (#245) --- docs/modules/ROOT/pages/index.adoc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/modules/ROOT/pages/index.adoc b/docs/modules/ROOT/pages/index.adoc index ca48334c..f108a5e1 100644 --- a/docs/modules/ROOT/pages/index.adoc +++ b/docs/modules/ROOT/pages/index.adoc @@ -310,13 +310,18 @@ Add start script to package.json To make hot module replacement work, add the following to the config object in vite.config.js: [source,javascript] ---- -server: { + server: { + port: 5173, + host: '127.0.0.1', hmr: { - port: 5173 + port: 5173, + host: '127.0.0.1', } -} + } ---- +You do need the host and port in both places to ensure the websocket is constructed and upgraded properly. + [#spa-routing] === Single Page application routing