Repository navigation
fix(cli): use process.versions.bun to detect missing getSystemErrorMap - #1465
Closed
sentry[bot] wants to merge 1 commit into
Closed
sentry[bot] wants to merge 1 commit into
sentry[bot] wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Closing this one: the failure it targets comes from an old release that didn't have the guard this PR rewrites.
- The event predates the guard. The linked issue has a single event, from CLI
0.19.0on Bun 1.3.9.0.19.0was released on 2026-03-20. ThehasGetSystemErrorMapcheck and theNodeSystemErrorfilter were added in getsentry/cli#523 (CLI-K1), which first shipped in0.20.0on 2026-03-23.src/lib/telemetry.tsat the0.19.0tag has nogetSystemErrorMaporNodeSystemErrorhandling at all. So this crash is the original CLI-K1 bug in an old binary, not the current check giving a wrong answer. - Nothing supports the "bundled
node:util" explanation. No event from a release that has the guard shows this error. Current releases are built as Node SEA binaries (seepackages/cli/AGENTS.md), not withbun build --compile. - The replacement is less accurate.
!process.versions.bunturns offNodeSystemErroron every Bun runtime, even one that implementsutil.getSystemErrorMap. The current check tests for the API the integration actually calls.
If a release with the guard (>= 0.20.0) ever shows getSystemErrorMap is not a function, that event would be the evidence to reopen this.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In bun-compiled binaries,
_require("node:util")resolved to the bundled Node.jsutilmodule (from the build environment), which hasgetSystemErrorMap. This causedhasGetSystemErrorMapto evaluate totrueeven when running on bun 1.3.9 wherenode:utilactually lacksgetSystemErrorMap, resulting in a crash insideNodeSystemError'sprocessEventhook (TypeError: _o.getSystemErrorMap is not a function).Replaced the
_require-based detection with!process.versions.bun, which accurately reflects the runtime environment regardless of bundler behavior.Fixes CLI-3HF
@sentry <feedback>: Autofix iterates on these changes@sentry stop iterating: Autofix stops iterating on this runThis PR was automatically generated by Sentry. You can adjust this setting at any time.