This repository was archived by the owner on Oct 23, 2026. It is now read-only.
Repository navigation
fix(cli): Handle empty regionUrl from self-hosted Sentry - #1522
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Sep 2, 2026
5 tasks
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Self-hosted Sentry instances can return an empty string (
"") forlinks.regionUrlwhen fetching organization details. The CLI's region resolution logic inpackages/cli/src/lib/region.tsused the nullish coalescing operator (??), which only guards againstnullorundefined. This allowed the empty string to be used as theregionUrl.Consequently, when
getSdkConfig("")was called, it led to the construction of a relative API URL (e.g.,/api/0/projects/...) without a base host. This relative URL then causednew Request()(fromundici) to throw aTypeError: Failed to parse URL.This fix changes the region resolution from
response.data?.links?.regionUrl ?? baseUrltoresponse.data?.links?.regionUrl || baseUrl. The logical OR operator (||) correctly treats an empty string as a falsy value, ensuring thatbaseUrlis used as a fallback whenregionUrlis an empty string. This prevents the invalid URL construction and the subsequentTypeError.Fixes CLI-2E1
@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.