Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,15 @@ export class Analytics {
host: ANALYTICS_HOST_URL,
flushAt: 1,
flushInterval: 0,
enableExceptionAutocapture: true,
// Only autocapture exceptions in published builds. The posthog-node
// client installs a process-wide handler that scoops up *any* exception
// in the process — in dev/test runs that includes unrelated throws (e.g.
// a vitest suite deliberately exercising a caught JSON.parse), which then
// surface as spurious issues in our own error tracking. Dev/CI runs still
// send their tagged analytics; they just don't hijack the process's
// exception handler. tsdown inlines IS_PRODUCTION_BUILD to `true` only in
// published builds.
enableExceptionAutocapture: IS_PRODUCTION_BUILD,
before_send: (event) => {
if (!event) return event;
if (Object.keys(this.groups).length > 0) {
Expand Down
Loading