Skip to content

fix(sentry): rewrite source map paths for GitHub code mapping#1435

Merged
piorpua merged 2 commits intomainfrom
fix/sentry-sourcemap-paths
Mar 19, 2026
Merged

fix(sentry): rewrite source map paths for GitHub code mapping#1435
piorpua merged 2 commits intomainfrom
fix/sentry-sourcemap-paths

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Add rewriteSources to Sentry Vite plugin to normalize source map paths
  • Converts Windows backslashes (\) to forward slashes (/)
  • Strips leading relative prefixes (../../) so paths start with src/
  • Enables Sentry stack traces to correctly link to GitHub source files via Code Mapping

Closes #1433

Test plan

  • CI build uploads source maps with corrected paths
  • Sentry stack traces show src/... paths instead of ../../src/...
  • GitHub "Open in GitHub" link works from Sentry issue detail

Add rewriteSources to Sentry Vite plugin to normalize source map paths
by converting Windows backslashes to forward slashes and stripping
leading relative prefixes (../../), so stack traces map correctly to
the GitHub repository structure.
piorpua
piorpua previously approved these changes Mar 19, 2026
The tray test's getTemplateFromRefresh helper failed on Linux CI because
vi.doMock('electron') was not fully resolved before tray.ts imported it.
Pre-importing electron ensures the mock is registered before the tray
module loads, preventing nativeImage from being undefined.
@kaizhou-lab kaizhou-lab force-pushed the fix/sentry-sourcemap-paths branch from c76cfb3 to d5b2cbb Compare March 19, 2026 07:09
@piorpua piorpua merged commit 79bc889 into main Mar 19, 2026
15 of 17 checks passed
@piorpua piorpua deleted the fix/sentry-sourcemap-paths branch March 19, 2026 07:21
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.

fix: Sentry source map paths prevent GitHub code mapping

2 participants