Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid consuming kibana response twice #921

Merged

Conversation

vigneshshanmugam
Copy link
Member

  • fix TypeError: unusable when creating a new project #920
  • Underlying error was triggered from Undici HTTP client when we consume the Response body twice during the error scenario, This hides the error message and throws the default TypeError instead. Copying docs from undici
Note: Once a mixin has been called then the body cannot be reused, thus calling additional mixins on .body, e.g. .body.json(); .body.text() will result in an error TypeError: unusable being thrown and returned through the Promise rejection.


src/push/request.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@emilioalvap emilioalvap left a comment

Choose a reason for hiding this comment

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

LGTM

@vigneshshanmugam vigneshshanmugam merged commit d2ae1ff into elastic:main May 3, 2024
6 checks passed
@vigneshshanmugam vigneshshanmugam deleted the fix-double-read-resp branch May 3, 2024 15:16
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.

TypeError: unusable when creating a new project
2 participants