Skip to content

Commit f4345f4

Browse files
committed
fixup! fix(cloudflare): Match re-exported classes by exported name only
1 parent 61594f0 commit f4345f4

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/cloudflare/src/vite/transform.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,11 +555,12 @@ function wrapLocalClassExport(
555555
ctx: TransformContext,
556556
state: TransformState,
557557
): void {
558-
if (state.renamedLocals.has(localName)) return;
558+
const classId = localClass.id;
559+
if (!classId || state.renamedLocals.has(localName)) return;
559560
state.renamedLocals.add(localName);
560561

561562
const renamedClass = `__SENTRY_ORIGINAL_${localName}__`;
562-
state.ms.overwrite(localClass.id!.start, localClass.id!.end, renamedClass);
563+
state.ms.overwrite(classId.start, classId.end, renamedClass);
563564
state.ms.appendLeft(
564565
localClass.end,
565566
`\nconst ${localName} = __SENTRY__.${WRAPPER_METHODS[kind]}(${state.optionsFn}, ${renamedClass});\n`,

0 commit comments

Comments
 (0)