From e89af45fdfece9e40ab37fa5337c642a86636ee2 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Thu, 4 Sep 2025 10:31:14 -0400 Subject: [PATCH] Use dynamic imports for jszip. --- src/actions/receive-profile.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actions/receive-profile.ts b/src/actions/receive-profile.ts index 47fcbb80a6..afebce45c4 100644 --- a/src/actions/receive-profile.ts +++ b/src/actions/receive-profile.ts @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { oneLine } from 'common-tags'; import queryString from 'query-string'; -import JSZip from 'jszip'; +import type JSZip from 'jszip'; import { insertExternalMarkersIntoProfile, insertExternalPowerCountersIntoProfile, @@ -1045,6 +1045,7 @@ async function _extractZipFromResponse( // that comes from this realm. const typedBuffer = new Uint8Array(buffer); try { + const JSZip = await import('jszip'); const zip = await JSZip.loadAsync(typedBuffer); // Catch the error if unable to load the zip. return zip; @@ -1235,6 +1236,7 @@ export function retrieveProfileFromFile( if (_deduceContentType(file.name, file.type) === 'application/zip') { // Open a zip file in the zip file viewer const buffer = await fileReader(file).asArrayBuffer(); + const JSZip = await import('jszip'); const zip = await JSZip.loadAsync(buffer); await dispatch(receiveZipFile(zip)); } else {