Skip to content

Commit

Permalink
Inject sentry release information at runtime not build time
Browse files Browse the repository at this point in the history
See #2871 for context of impact.
  • Loading branch information
hughns committed Dec 18, 2024
1 parent 7783c72 commit 1d08edd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/initializer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class Initializer {
Sentry.reactRouterV5BrowserTracingIntegration({ history }),
],
tracesSampleRate: 1.0,
release: process.env.VITE_APP_VERSION,
});
}
// Sentry is now 'loadeed' (even if we actually skipped starting
Expand Down
4 changes: 4 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ export default defineConfig(({ mode }) => {
sentryVitePlugin({
release: {
name: process.env.VITE_APP_VERSION,
// We don't inject the release info at build time because it has a side effect of
// changing the asset hashes each time meaning that it breaks browser caching.
// Instead we pass it in at runtime via Sentry.init().
inject: false,
},
}),
);
Expand Down

0 comments on commit 1d08edd

Please sign in to comment.