Skip to content

Commit 6e83a6b

Browse files
author
Luca Forstner
authored
fix(nextjs): Only re-export default export if it exists (#8800)
1 parent 2cd6ea5 commit 6e83a6b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/nextjs/src/config/templates/sentryInitWrapperTemplate.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import '__SENTRY_CONFIG_IMPORT_PATH__';
44

55
// @ts-ignore This is the file we're wrapping
66
// eslint-disable-next-line import/no-unresolved
7-
export * from '__SENTRY_WRAPPING_TARGET_FILE__';
7+
import * as wrappee from '__SENTRY_WRAPPING_TARGET_FILE__';
8+
9+
// @ts-ignore default either exists, or it doesn't - we don't care
10+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
11+
const defaultExport = wrappee.default;
812

913
// @ts-ignore This is the file we're wrapping
1014
// eslint-disable-next-line import/no-unresolved
11-
export { default } from '__SENTRY_WRAPPING_TARGET_FILE__';
15+
export * from '__SENTRY_WRAPPING_TARGET_FILE__';
16+
17+
export default defaultExport;

0 commit comments

Comments
 (0)