Skip to content

fix(astro): Avoid adding the Sentry Vite plugin in dev mode #9688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented Nov 28, 2023

This PR adds a guard to avoid adding the Sentry Vite plugin for source maps upload in dev mode.
Reason: The vite plugin ships with a Sentry SDK. This SDK conflicts with the Astro server-side SDK. For example for some reason, it skews up the line numbers of stack frames. Not exactly sure why that's happening but my best guess is that the plugin SDK somehow changes code (maybe we even inject debugIds or release values or something like this) that mixes up line numbers.

Anyway, I think it's generally more correct to not use the plugin in dev mode.

@Lms24 Lms24 requested review from HazAT and lforst November 28, 2023 15:11
@Lms24 Lms24 enabled auto-merge (squash) November 28, 2023 15:22
@Lms24 Lms24 merged commit bbe8812 into develop Nov 28, 2023
@Lms24 Lms24 deleted the lms/fix-astro-viteplugin-not-in-dev-mode branch November 28, 2023 15:27
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.

2 participants