decentralized-identity / decentralized-identity/hub-sdk-js

HubSession.makeRequest.res.buffer(); exception

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
15
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Hi all!
Currently playing with Angular 6 and your SDK and found the next issue:
``
ERROR Error: Uncaught (in promise): TypeError: res.buffer is not a function
TypeError: res.buffer is not a function
at HubSession. (HubSession.js:143)
at step (HubSession.js:32)
at Object.next (HubSession.js:13)
at fulfilled (HubSession.js:4)
at ZoneDelegate.invoke (zone-evergreen.js:359)
at Object.onInvoke (core.js:39698)
at ZoneDelegate.invoke (zone-evergreen.js:358)
at Zone.run (zone-evergreen.js:124)
at zone-evergreen.js:855
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at resolvePromise (zone-evergreen.js:797)
at zone-evergreen.js:707
at rejected (tslib.es6.js:71)
at ZoneDelegate.invoke (zone-evergreen.js:359)
at Object.onInvoke (core.js:39698)
at ZoneDelegate.invoke (zone-evergreen.js:358)
at Zone.run (zone-evergreen.js:124)
at zone-evergreen.js:855
at ZoneDelegate.invokeTask (zone-evergreen.js:391)
at Object.onInvokeTask (core.js:39679)``

I have tried different approaches, but the only solution works for me fine - change line 155 in the source file (line 143 in compilled HubSession.js file) from `` const response = await res.buffer();``
to `` const response = await res.text();``.
On Mozilla dev site (https://developer.mozilla.org/en-US/docs/Web/API/Response) I found that response object does not have ``buffer`` property.

Should this be changed or I did something wrong?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.