-
-
Notifications
You must be signed in to change notification settings - Fork 32
fix(sentry): Upload and use source maps for all build targets #1241
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
Conversation
- Fix release name consistency between build-time and runtime (spotlight@version format) - Add source map upload for Electron renderer process - Inject version constant for fossilized binaries (CLI/Docker) to ensure correct release matching - Clean up source maps after upload to reduce bundle size - Ensure consistent release naming across Electron main/renderer, CLI, and MCP server Fixes source map symbolication issues in Sentry for: - Electron app (main + renderer processes) - CLI/npx runs - Docker images - Fossilized standalone binaries - MCP server
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
|
||
| export const defineProduction = { | ||
| "process.env.NODE_ENV": '"production"', | ||
| "process.env.npm_package_version": JSON.stringify(process.env.npm_package_version), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is redundant now then? Or __SPOTLIGHT_VERSION__ was never needed. Which one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both are needed for different scenarios:
__SPOTLIGHT_VERSION__: Injected at build time via Vitedefine, so it's baked into the code and available everywhere, including fossilized binaries (CLI/Docker standalone executables) whereprocess.env.npm_package_versionisundefinedprocess.env.npm_package_version: Available at runtime for npm/npx runs, but not in fossilized binaries
The code in sentry-config.ts prefers __SPOTLIGHT_VERSION__ but falls back to process.env.npm_package_version as a safety net. This ensures:
- Fossilized binaries work (they only have
__SPOTLIGHT_VERSION__) - npm/npx runs work (both available, but
__SPOTLIGHT_VERSION__takes precedence) - Development builds work (fallback to env var)
We keep process.env.npm_package_version in defineProduction because other parts of the codebase may reference it directly, not just Sentry.
|
Responding to review comment on line 15: Both are needed for different scenarios:
The code in
We keep |
|
Yay, look at me talking to myself online |
Summary
This PR fixes source map generation, upload, and runtime association across all build targets to ensure proper error stack trace symbolication in Sentry.
Changes
Impact
Fixes source map symbolication for:
Evidence
Verified source map issues in Sentry:
After this fix, errors will show original TypeScript source paths and proper line numbers.