sentry-javascript: Incorrect `NEXTJS_REQUEST_ASYNC_STORAGE_MODULE_PATH` in Next.js 13.4.20

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.68.0

Framework Version

13.4.20

Link to Sentry event

No response

SDK Setup

npx @sentry/wizard@latest -i nextjs

Steps to Reproduce

  1. Install the Next.js canary release (yarn add next@13.4.20-canary.20) in a project using the Next.js 13 App Directory and Route Handlers.
  2. Implement the Sentry plugin in next.config.js.
  3. Run next build.
  4. Observe a console warning: The Sentry SDK could not access the RequestAsyncStorage module. Certain features may not work. There is nothing you can do to fix this yourself, but future SDK updates may resolve this.
  5. Observe an error when building each route handler wrapped by Sentry: Module not found: Can't resolve '@sentry/nextjs/build/esm/config/templates/requestAsyncStorageShim.js'

Expected Result

Next.js should successfully build all Route Handlers wrapped by Sentry

Actual Result

Identified the offending line in packages/nextjs/src/config/loaders/wrappingLoader.ts#L19, which should use next/dist/client/components/request-async-storage.external

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Reactions: 2
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Just updated to Next.js 13.5.1 with SDK Version 7.69.0 & I receive the error:

Module not found: Can't resolve 'next/dist/client/components/request-async-storage'

This issue doesn’t seem to occur when I remove Sentry. Does everybody else experience this issue?