-
Notifications
You must be signed in to change notification settings - Fork 901
fix(desktop): bundle Sentry and add sourcemap uploads #875
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 184
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 184
🏁 Script executed:
Repository: superset-sh/superset
Length of output: 184
🌐 Web query:
@sentry/vite-plugin v4.7.0 Vite 7 compatibility requirements💡 Result:
Do you want me to fetch the exact peerDependencies/package.json for
@sentry/vite-pluginv4.7.0 (to confirm which Vite versions it supports)?🌐 Web query:
@sentry/vite-plugin release option configuration electron-vite💡 Result:
Summary — how to configure the plugin's release options when using
@sentry/vite-pluginwith electron-viteKey facts
@sentry/vite-pluginexposes a release option object with most-used fields: name (or SENTRY_RELEASE env var), inject, create, finalize, dist, vcsRemote, setCommits, deploy, cleanArtifacts, etc. Use release.name to force a specific release identifier. [1][2]Minimal example (electron.vite.config.ts)
Example snippet:
import { defineConfig } from 'electron-vite'
import { sentryVitePlugin } from '@sentry/vite-plugin'
export default defineConfig({
main: {
build: { sourcemap: true },
plugins: [
sentryVitePlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
sourcemaps: { include: './out/main' }, // adjust paths as needed
release: {
name: process.env.SENTRY_RELEASE || 'my-app@' + process.env.npm_package_version,
inject: true, // inject release into bundles (recommended)
create: true, // create release on Sentry during build
finalize: true,
dist: process.env.BUILD_NUMBER,
setCommits: { auto: true },
},
}),
],
},
renderer: {
build: { sourcemap: true },
plugins: [
sentryVitePlugin({
/* same org/project/authToken */
release: { name: process.env.SENTRY_RELEASE || 'my-app@' + process.env.npm_package_version, inject: true },
}),
],
},
})
Practical tips
Sources
@sentry/vite-pluginoptions (release.* docs). [1]🌐 Web query:
@sentry/vite-plugin 4.7.0 peerDependencies Vite version support💡 Result:
Short answer:
@sentry/vite-pluginv4.7.0 supports Vite v4 and v5. See Sentry's Vite docs and the bundler-plugins repo/issues showing usage and compatibility with Vite 4/5. [1][2]Sources:
🌐 Web query:
@sentry/vite-plugin electron-vite 4.0 compatibility💡 Result:
Short answer: generally yes —
@sentry/vite-plugincan be used with electron-vite, but you must match versions and watch a few caveats.Details and recommendations:
@sentry/vite-plugintargets Vite builds and the official docs show using it in Vite projects for sourcemap/release upload — use the latest@sentry/vite-pluginand enable sourcemaps in your Vite build. [1][2]@sentry/vite-pluginsupports that Vite major version. [3]@sentry/vite-pluginversions interact with some Vite setups/plugins (errors uploading/failing builds). Test your full electron-vite build (main/preload/renderer) and adjust sentry plugin config (assets/sourcemap paths, placement after other plugins) if you hit problems. See related issues for troubleshooting. [4]If you want, tell me your electron-vite version, Vite version, and the
@sentry/vite-pluginversion you plan to use and I’ll give precise compatibility guidance and a minimal working config.@sentry/vite-plugin v4.7.0 does not support Vite 7.x — it only supports Vite 4 and 5. If this project uses Vite 7, upgrade to a newer version of
@sentry/vite-plugin(v4.8.0+) that supports Vite 7. Thereleaseoption is fully supported with your configuration.🤖 Prompt for AI Agents