From 6ff716ed274c8ecb3545e19efd58ea8eef5f8461 Mon Sep 17 00:00:00 2001 From: Ashraf Ahmed <50865559+Ashr4f@users.noreply.github.com> Date: Thu, 12 Dec 2024 08:39:19 +0100 Subject: [PATCH] fix: Add guard for undefined global module Based on bundler, module might be undefined, I've added a guard to fix this problem. --- src/ui/HOC.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/HOC.tsx b/src/ui/HOC.tsx index 3a161a48..d5703f5c 100644 --- a/src/ui/HOC.tsx +++ b/src/ui/HOC.tsx @@ -73,7 +73,7 @@ export function lazy(importer: LazyImport): React.FC { if (process.env.NODE_ENV !== 'production') { // lazy is not hot-reloadable - if ((module as any).hot) { + if (typeof module !== 'undefined' && (module as any)?.hot) { return loader(importer, { async: true }); } }