From 0be3137b204baef57a36094649b118cbfde77052 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Thu, 10 Oct 2024 09:14:48 +0200 Subject: [PATCH] fix(nextjs): Adjust path to `requestAsynStorageShim.js` template file (#13928) Looks like we missed adding the `build` dir to the template path of `requestAsyncStorageShim` in the NextJS SDK when we changed the package-internal directory structure a while ago (IIRC this was pre-v8 but not sure actually) I'm a bit surprised that this works at all, given we use `exports` conditions and this is a path to a specific file not covered by any `exports` entry. But I guess webpack can handle this still. EDIT: Well turns out, this doesn't work. We'll need to add the `exports` entries. fixes https://github.com/getsentry/sentry-javascript/issues/13925 closes https://github.com/getsentry/sentry-javascript/issues/13926 closes https://github.com/getsentry/sentry-javascript/issues/13927 --- packages/nextjs/src/config/loaders/wrappingLoader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextjs/src/config/loaders/wrappingLoader.ts b/packages/nextjs/src/config/loaders/wrappingLoader.ts index ea7828497f95..943e4c93578f 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/esm/config/templates/requestAsyncStorageShim.js', + '@sentry/nextjs/build/esm/config/templates/requestAsyncStorageShim.js', ); }