Skip to content

fix(nextjs): widen project option type to string | string[]#21067

Merged
nicohrubec merged 1 commit into
getsentry:developfrom
delorge:fix/nextjs-project-option-type
May 21, 2026
Merged

fix(nextjs): widen project option type to string | string[]#21067
nicohrubec merged 1 commit into
getsentry:developfrom
delorge:fix/nextjs-project-option-type

Conversation

@delorge
Copy link
Copy Markdown
Contributor

@delorge delorge commented May 20, 2026

@sentry/bundler-plugin-core accepts string | string[] for project but SentryBuildOptions narrowed it to string, causing a TS error when users passed an array even though the value is forwarded verbatim.

Before submitting a pull request, please take a look at our
Contributing guidelines and verify:

  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).
  • Link an issue if there is one related to your pull request. If no issue is linked, one will be auto-generated and linked.

Closes #21066

`@sentry/bundler-plugin-core` accepts `string | string[]` for `project`
but `SentryBuildOptions` narrowed it to `string`, causing a TS error
when users passed an array even though the value is forwarded verbatim.

Co-Authored-By: claude-sonnet-4-6 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@nicohrubec nicohrubec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix looks good to me. we actually seem to have this problem in other frameworks as well, thanks for the contribution!

@nicohrubec nicohrubec self-assigned this May 20, 2026
@nicohrubec nicohrubec merged commit a8420ef into getsentry:develop May 21, 2026
70 checks passed
nicohrubec added a commit that referenced this pull request May 21, 2026
This PR adds the external contributor to the CHANGELOG.md file, so that
they are credited for their contribution. See #21067

Co-authored-by: nicohrubec <29484629+nicohrubec@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants