Skip to content

Commit 0ec8c82

Browse files
committed
fix(esbuild): strip query strings from importer paths in metadata proxy check
1 parent 65c3e76 commit 0ec8c82

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/esbuild-plugin/src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ function esbuildDebugIdInjectionPlugin(logger: Logger): UnpluginOptions {
7575

7676
// Check if this import is coming from a metadata proxy module
7777
// The metadata plugin registers entry points it wraps in the shared Set
78+
// We need to strip the query string suffix because esbuild includes the suffix
79+
// (e.g., ?sentryMetadataProxyModule=true) in args.importer
80+
const importerPath = args.importer?.split("?")[0];
7881
const isImportFromMetadataProxy =
7982
args.kind === "import-statement" &&
80-
args.importer !== undefined &&
81-
metadataProxyEntryPoints.has(args.importer);
83+
importerPath !== undefined &&
84+
metadataProxyEntryPoints.has(importerPath);
8285

8386
if (!isEntryPoint && !isImportFromMetadataProxy) {
8487
return;

packages/integration-tests/fixtures/application-key-with-debug-id/application-key-with-debug-id.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,3 @@ describe("applicationKey with debug ID injection", () => {
5555
checkBundle(path.join(__dirname, "out", "vite", "bundle.js"));
5656
});
5757
});
58-

0 commit comments

Comments
 (0)