From 8adb35cb49110f4bb819b1b715026b926327ce69 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Mon, 12 Feb 2024 11:09:02 +0100 Subject: [PATCH] fix(sveltekit): Properly await sourcemaps flattening --- packages/sveltekit/src/vite/sourceMaps.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/sveltekit/src/vite/sourceMaps.ts b/packages/sveltekit/src/vite/sourceMaps.ts index eea862e9d901..2f5fd28ac1f8 100644 --- a/packages/sveltekit/src/vite/sourceMaps.ts +++ b/packages/sveltekit/src/vite/sourceMaps.ts @@ -166,7 +166,7 @@ export async function makeCustomSentryVitePlugin(options?: CustomSentryVitePlugi // eslint-disable-next-line no-console debug && console.log('[Source Maps Plugin] Flattening source maps'); - jsFiles.forEach(async file => { + for (const file of jsFiles) { try { await (sorcery as Sorcery).load(file).then(async chain => { if (!chain) { @@ -202,7 +202,7 @@ export async function makeCustomSentryVitePlugin(options?: CustomSentryVitePlugi ); await fs.promises.writeFile(mapFile, cleanedMapContent); } - }); + } try { // @ts-expect-error - this hook exists on the plugin!