Skip to content

Incorrect NEXTJS_REQUEST_ASYNC_STORAGE_MODULE_PATH in Next.js 13.4.20 #8977

Closed
@Burry

Description

@Burry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions