Skip to content

Commit fe2c801

Browse files
authored
fix(nextjs): Fix package.json exports (#8895)
1 parent 0fd86bc commit fe2c801

File tree

4 files changed

+2
-18
lines changed

4 files changed

+2
-18
lines changed

packages/nextjs/package.json

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@
1313
"module": "build/esm/index.server.js",
1414
"browser": "build/esm/index.client.js",
1515
"types": "build/types/index.types.d.ts",
16-
"exports": {
17-
".": {
18-
"import": "./build/esm/index.server.js",
19-
"require": "./build/cjs/index.server.js",
20-
"types": "./build/types/index.types.d.ts"
21-
},
22-
"./requestAsyncStorageShim": {
23-
"import": "./build/esm/config/templates/requestAsyncStorageShim.js"
24-
}
25-
},
2616
"typesVersions": {
2717
"<4.9": {
2818
"build/npm/types/index.d.ts": [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export default function wrappingLoader(
191191
}
192192
templateCode = templateCode.replace(
193193
/__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__/g,
194-
'@sentry/nextjs/requestAsyncStorageShim',
194+
'@sentry/nextjs/build/esm/config/templates/requestAsyncStorageShim.js',
195195
);
196196
}
197197

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,3 @@ export interface RequestAsyncStorage {
77
}
88
| undefined;
99
}
10-
11-
export const requestAsyncStorage: RequestAsyncStorage = {
12-
getStore: () => {
13-
return undefined;
14-
},
15-
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ if (typeof serverComponent === 'function') {
2828
let sentryTraceHeader: string | undefined | null = undefined;
2929
let baggageHeader: string | undefined | null = undefined;
3030

31-
// We try-catch here just in case the API around `requestAsyncStorage` changes unexpectedly since it is not public API
31+
// We try-catch here just in `requestAsyncStorage` is undefined since it may not be defined
3232
try {
3333
const requestAsyncStore = requestAsyncStorage.getStore();
3434
sentryTraceHeader = requestAsyncStore?.headers.get('sentry-trace');

0 commit comments

Comments
 (0)