From f74ab8f84a14e662e4f6d88eb0f2793fa9dc5ac9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Sat, 29 Jul 2023 12:31:51 +0800 Subject: [PATCH] fix: server not have window --- src/hooks/useHMR.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/hooks/useHMR.ts b/src/hooks/useHMR.ts index 7c5f725e..ff54518b 100644 --- a/src/hooks/useHMR.ts +++ b/src/hooks/useHMR.ts @@ -16,7 +16,8 @@ if ( process.env.NODE_ENV !== 'production' && typeof module !== 'undefined' && module && - module.hot + (module as any).hot && + typeof window !== 'undefined' ) { const win = window as any; if (typeof win.webpackHotUpdate === 'function') {