From 00cb77de8fff60f4858ce23b13d18b17e6157009 Mon Sep 17 00:00:00 2001 From: rash Date: Mon, 23 Feb 2026 16:43:11 +0100 Subject: [PATCH] top level await in iife build mode is not supported, so let's do import.meta.glob instead (we just need the build step not to see await, the code doesn't actually ever get loaded because it's DEV only) --- src/pretix/static/pretixpresale/widget/src/i18n.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixpresale/widget/src/i18n.ts b/src/pretix/static/pretixpresale/widget/src/i18n.ts index e4caf3b289..0a1b612f9b 100644 --- a/src/pretix/static/pretixpresale/widget/src/i18n.ts +++ b/src/pretix/static/pretixpresale/widget/src/i18n.ts @@ -15,7 +15,10 @@ let django: Django if (import.meta.env.DEV) { // TODO this does not actually grab the correct language strings - const raw = (await import(`../../../jsi18n/${LANG}/djangojs.js?raw`)).default + const modules = import.meta.glob('../../../jsi18n/*/djangojs.js', { eager: true, query: '?raw', import: 'default' }) as Record + const key = `../../../jsi18n/${LANG}/djangojs.js` + const raw = modules[key] + if (!raw) throw new Error(`Missing i18n module for lang "${LANG}": ${key}`) const context: { django?: Django } = {} new Function(raw).call(context) django = context.django!