From 3bd55bcb7e831d2c4f66c90d7bbb3e1fbf7a02b6 Mon Sep 17 00:00:00 2001 From: patak <583075+patak-dev@users.noreply.github.com> Date: Tue, 14 Jan 2025 07:34:21 +0100 Subject: [PATCH] fix: avoid SSR HMR for HTML files (#19193) --- packages/vite/src/node/server/hmr.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vite/src/node/server/hmr.ts b/packages/vite/src/node/server/hmr.ts index 8683f9a7b37c24..8d3d83b39fcf1a 100644 --- a/packages/vite/src/node/server/hmr.ts +++ b/packages/vite/src/node/server/hmr.ts @@ -579,7 +579,7 @@ export async function handleHMRUpdate( } if (!options.modules.length) { // html file cannot be hot updated - if (file.endsWith('.html')) { + if (file.endsWith('.html') && environment.name === 'client') { environment.logger.info( colors.green(`page reload `) + colors.dim(shortFile), {