diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 0e5906f92908..d992a8c46f8e 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -46,6 +46,14 @@ "node": "./build/cjs/index.server.js", "import": "./build/esm/index.server.js" }, + "./async-storage-shim": { + "import": { + "default": "./build/esm/config/templates/requestAsyncStorageShim.js" + }, + "require": { + "default": "./build/cjs/config/templates/requestAsyncStorageShim.js" + } + }, "./import": { "import": { "default": "./build/import-hook.mjs" diff --git a/packages/nextjs/src/config/loaders/wrappingLoader.ts b/packages/nextjs/src/config/loaders/wrappingLoader.ts index 943e4c93578f..d3c1d62c9330 100644 --- a/packages/nextjs/src/config/loaders/wrappingLoader.ts +++ b/packages/nextjs/src/config/loaders/wrappingLoader.ts @@ -174,7 +174,7 @@ export default function wrappingLoader( } templateCode = templateCode.replace( /__SENTRY_NEXTJS_REQUEST_ASYNC_STORAGE_SHIM__/g, - '@sentry/nextjs/build/esm/config/templates/requestAsyncStorageShim.js', + '@sentry/nextjs/async-storage-shim', ); } diff --git a/packages/nextjs/src/config/templates/requestAsyncStorageShim.ts b/packages/nextjs/src/config/templates/requestAsyncStorageShim.ts index 4acb61e78444..483d00341312 100644 --- a/packages/nextjs/src/config/templates/requestAsyncStorageShim.ts +++ b/packages/nextjs/src/config/templates/requestAsyncStorageShim.ts @@ -7,3 +7,6 @@ export interface RequestAsyncStorage { } | undefined; } + +export const requestAsyncStorage = undefined; +export const workUnitAsyncStorage = undefined;