From a8b6ad6bdd1fe9bbe1d7868ce80d5a2cd4c7cf98 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 15 Aug 2025 16:00:42 -0700 Subject: [PATCH] fix: temporal dead zone issue when bundling inspector_modules --- packages/core/inspector_modules.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/core/inspector_modules.ts b/packages/core/inspector_modules.ts index c9e283d69..36462e227 100644 --- a/packages/core/inspector_modules.ts +++ b/packages/core/inspector_modules.ts @@ -13,7 +13,9 @@ import './debugger/webinspector-css'; * NOTE: This likely should not be in core because errors can happen on boot before core is fully loaded. Ideally the runtime should provide this in full but unsure. */ import { File, knownFolders } from './file-system'; -import { SourceMapConsumer } from 'source-map-js'; +// import/destructure style helps commonjs/esm build issues +import * as sourceMapJs from 'source-map-js'; +const { SourceMapConsumer } = sourceMapJs; // note: webpack config can by default use 'source-map' files with runtimes v9+ // helps avoid having to decode the inline base64 source maps @@ -22,7 +24,7 @@ const usingSourceMapFiles = true; let loadedSourceMaps: Map; let consumerCache: Map; -function getConsumer(mapPath: string, sourceMap: any): SourceMapConsumer { +function getConsumer(mapPath: string, sourceMap: any) { if (!consumerCache) { consumerCache = new Map(); }