diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts index 40c428e65..6cbcd2a46 100644 --- a/src/webpack/patchWebpack.ts +++ b/src/webpack/patchWebpack.ts @@ -89,13 +89,13 @@ define(Function.prototype, "m", { }); // The proxy responsible for patching the module factories when they are set, or definining getters for the patched versions - moduleFactories = new Proxy(moduleFactories, moduleFactoriesHandler); + const proxiedModuleFactories = new Proxy(moduleFactories, moduleFactoriesHandler); /* If Discord ever decides to set module factories using the variable of the modules object directly, instead of wreq.m, switch the proxy to the prototype Reflect.setPrototypeOf(moduleFactories, new Proxy(moduleFactories, moduleFactoriesHandler)); */ - define(this, "m", { value: moduleFactories }); + define(this, "m", { value: proxiedModuleFactories }); // Patch the pre-populated factories for (const id in moduleFactories) {