Skip to content

Conversation

@nicohrubec
Copy link
Member

sentryVitePlugin is typed to return VitePlugin[]. The problem is that in case the factory we use returns an array with only a single entry, unplugin will return a single plugin instead of an array. This can happen when the factory bails early and returns only the sentry-noop-plugin.

In other plugins this doesn't seem to be an issue, since we use any as the return type there.

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Nice, thanks! Can you check if this is also an issue in the other plugins? Feel free to open follow-up PRs but ideally we can get rid of this bug everywhere

@nicohrubec
Copy link
Member Author

@Lms24 This is what I meant with "In other plugins this doesn't seem to be an issue, since we use any as the return type there." in the PR description, i.e. this seems to be the only plugin that has this bug so I think we are good

@nicohrubec nicohrubec merged commit 0ed8414 into main Jan 14, 2026
24 checks passed
@nicohrubec nicohrubec deleted the nh/always-return-plugin-array branch January 14, 2026 15:45
@Lms24
Copy link
Member

Lms24 commented Jan 14, 2026

argh should have read the pr description ... should have read the pr description ... thanks Nico!

@Lms24
Copy link
Member

Lms24 commented Jan 14, 2026

since we use any as the return type there

although ... we should change that probably 😬

@nicohrubec
Copy link
Member Author

nicohrubec commented Jan 14, 2026

we probably should in the next major, I'll open an issue

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.

3 participants