Skip to content

Commit

Permalink
fix: Fixed injecting, error undefined VERSION (close #1851)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Apr 24, 2024
1 parent 98d7f18 commit 8ccbf06
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/webpack/index.ts
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

import { compare } from 'compare-versions';
import Debug from 'debug';

import { internalEv } from '../eventEmitter';
Expand Down Expand Up @@ -166,7 +165,7 @@ export function injectLoader(): void {
const chunkName = 'webpackChunkwhatsapp_web_client';

const chunk = global[chunkName] || [];
if (compare(self.Debug.VERSION, '2.3000.0', '>=')) {
if (!chunk || chunk?.length === 0) {
Object.defineProperty(global, chunkName, chunk);
} else {
loaderType = 'webpack';
Expand Down

0 comments on commit 8ccbf06

Please sign in to comment.