Skip to content

[@sentry/nextjs]: project option in withSentryConfig typed as string but bundler plugin accepts `string | string[] #21066

@delorge

Description

@delorge

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

10.53.1

Framework Version

No response

Link to Sentry event

No response

Reproduction Example/SDK Setup

Config's type definition declares project?: string, but the underlying @sentry/bundler-plugin-core types project as string | string[]
(source).

Build plugin option forwards the value verbatim to the bundler plugin - meaning the runtime already accepts arrays, but the TypeScript type rejects them at compile time. And it also breaks discoverability for agents.

Steps to Reproduce

withSentryConfig(nextConfig, {
  project: ['proj-a', 'proj-b'],
})

Expected Result

No TypeScript error — project accepts string | string[].

Actual Result

Type 'string[]' is not assignable to type 'string | undefined'.

Additional Context

No response

Priority

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions