Skip to content

Commit cebf74f

Browse files
author
Luca Forstner
authored
fix(nextjs): Make SDK multiplexer more resilient (#6905)
1 parent 7c2df8e commit cebf74f

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

packages/nextjs/src/config/loaders/sdkMultiplexerLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type LoaderOptions = {
1313
* or edge-runtime code.
1414
*/
1515
export default function sdkMultiplexerLoader(this: LoaderThis<LoaderOptions>, userCode: string): string {
16-
if (!userCode.includes('__SENTRY_SDK_MULTIPLEXER__')) {
16+
if (!userCode.includes('_SENTRY_SDK_MULTIPLEXER')) {
1717
return userCode;
1818
}
1919

packages/nextjs/src/index.client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ export * from './client';
33
// This file is the main entrypoint for non-Next.js build pipelines that use
44
// the package.json's "browser" field or the Edge runtime (Edge API routes and middleware)
55

6-
// __SENTRY_SDK_MULTIPLEXER__
6+
/**
7+
* This const serves no purpose besides being an identifier for this file that the SDK multiplexer loader can use to
8+
* determine that this is in fact a file that wants to be multiplexed.
9+
*/
10+
export const _SENTRY_SDK_MULTIPLEXER = true;

packages/nextjs/src/index.server.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ export * from './server';
33

44
// This file is the main entrypoint on the server and/or when the package is `require`d
55

6-
// __SENTRY_SDK_MULTIPLEXER__
6+
/**
7+
* This const serves no purpose besides being an identifier for this file that the SDK multiplexer loader can use to
8+
* determine that this is in fact a file that wants to be multiplexed.
9+
*/
10+
export const _SENTRY_SDK_MULTIPLEXER = true;

0 commit comments

Comments
 (0)