From 265cf12d392c8a0bfbf585f77bf76a3acab34c55 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Sun, 26 May 2024 05:24:03 -0300 Subject: [PATCH] I love --- src/webpack/patchWebpack.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 6aeee236f..e756d3d0b 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -299,8 +299,8 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) { // eslint-disable-next-line prefer-const let [module, exports, require] = args; - // Make sure the require argument is actually the WebpackRequire functioin - if (wreq == null && String(require).includes("exports:{}")) { + // Make sure the require argument is actually the WebpackRequire function + if (wreq == null && typeof require === "function" && require.m != null) { const { stack } = new Error(); const webpackInstanceFileName = stack?.match(/\/assets\/(.+?\.js)/)?.[1]; logger.warn( @@ -328,7 +328,7 @@ function patchFactory(id: PropertyKey, factory: ModuleFactory) { // There are (at the time of writing) 11 modules exporting the window // Make these non enumerable to improve webpack search performance - if (exports === window && require?.c) { + if (exports === window && typeof require === "function" && require.c != null) { Reflect.defineProperty(require.c, id, { value: require.c[id], configurable: true,