Skip to content

Stop reporting user/environment errors as unexpected bugs#7168

Merged
lucyxiang merged 1 commit into
mainfrom
04-02-suppress_user_environment_errors_from_bugsnag
Apr 17, 2026
Merged

Stop reporting user/environment errors as unexpected bugs#7168
lucyxiang merged 1 commit into
mainfrom
04-02-suppress_user_environment_errors_from_bugsnag

Conversation

@lucyxiang

@lucyxiang lucyxiang commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds 2 new patterns to errorMessageImpliesEnvironmentIssue in cli-kit/error.ts to prevent common user environment errors from being reported as unhandled CLI bugs in Bugsnag/error-analytics.

These errors are caused by the user's environment, not CLI bugs. They were showing up as handled=false (unexpected) in error-analytics, creating noise.

Patterns added

Pattern Events (7d) Cause Observe
write EPIPE ~1,540 User's process exits or terminal closes mid-output, breaking the pipe. Stacks are 100% node:internal/stream_base_commons. 293820890752078061, 10594213926861919143
Unsupported platform ~16 User runs CLI on an unsupported OS/arch combination (e.g. win32 arm64). Stacks originate from workerd/lib/main.js platform check. 12730362776183823558

Patterns considered but excluded

Pattern Reason
Cannot find module ~1% of events are missing files inside @shopify/cli/dist/ which could indicate packaging bugs.
does not provide an export named Matches minified Shopify admin bundle errors (e.g. FlowBasedAutomationsQuery...export 'f') — those are real bugs, not user issues.
is not exported by Same concern — could match internal Shopify code bundle failures.
Build failed Could mask real package bugs (e.g. our vite plugin or preset breaking builds).
Build function failed Same — e.g. Hydrogen preset throws plain Error for unsupported config like buildEnd, which is our code.

Each included pattern was verified by inspecting individual stack traces to confirm zero CLI/Shopify code is involved.

Test plan

  • Added test cases for both new patterns in error.test.ts
  • All existing tests continue to pass
  • Verify error volume reduction in Observe after deploy

🤖 Generated with Claude Code

@lucyxiang lucyxiang requested a review from a team as a code owner April 2, 2026 17:15
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@lucyxiang lucyxiang force-pushed the 04-02-suppress_user_environment_errors_from_bugsnag branch from 423df70 to 0d134b9 Compare April 2, 2026 19:04
Add 'write EPIPE' and 'Unsupported platform' to
errorMessageImpliesEnvironmentIssue so they are no longer flagged
as unhandled CLI bugs in error-analytics.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lucyxiang lucyxiang force-pushed the 04-02-suppress_user_environment_errors_from_bugsnag branch from 0d134b9 to 837772e Compare April 15, 2026 17:32

@alfonso-noriega alfonso-noriega left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! thanks

@lucyxiang lucyxiang added this pull request to the merge queue Apr 17, 2026
Merged via the queue into main with commit a889d3c Apr 17, 2026
45 of 46 checks passed
@lucyxiang lucyxiang deleted the 04-02-suppress_user_environment_errors_from_bugsnag branch April 17, 2026 18:09
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.

2 participants