Skip to content

Stop reporting user/environment errors as unexpected bugs#7168

Open
lucyxiang wants to merge 1 commit intomainfrom
04-02-suppress_user_environment_errors_from_bugsnag
Open

Stop reporting user/environment errors as unexpected bugs#7168
lucyxiang wants to merge 1 commit intomainfrom
04-02-suppress_user_environment_errors_from_bugsnag

Conversation

@lucyxiang
Copy link
Copy Markdown
Contributor

@lucyxiang lucyxiang commented Apr 2, 2026

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
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

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.

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 423df70 to 0d134b9 Compare April 2, 2026 19:04
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.

1 participant