Skip to content

Next.js Config as function is unsupported sometime after 7.12.1 #6447

Description

@kylemh

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which package are you using?

@sentry/nextjs

SDK Version

7.23.0

Framework Version

Next.js 12.3.4

Link to Sentry event

No response

Steps to Reproduce

  1. Open this sandbox link
  2. Run yarn build
  3. Notice that Next.js throws an error that the config is a function instead of an object. Next.js actually runs, but my entire config has been ignored.

Expected Result

When using the Sentry plugin, my original Next.js config is maintained. It's valid to use next.config.js as a function (as described here) and necessary in order to even use this plugin since it's a partial function.

Actual Result

See sandbox link in STR.

I think this is the culprit: #6291


For whatever fix gets applied here, I think it'd be ideal to include a test for a Next.js application with multiple plugins to protect against regression.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions