decentralized-identity / hub-node-core

Node.js implementation of the Identity Hub interfaces, business logic, and replication protocol.
Apache License 2.0
17 stars 7 forks source link

Fetch invocation error when running on non-node client #9

Open codeglobally opened 5 years ago

codeglobally commented 5 years ago

Running code in a browser/non-node client results in the exception _Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation at indexOP.js:30496 at Generator.next () at indexOP.js:30436 at new Promise () at _awaiter (indexOP.js:30432) at genDid (indexOP.js:30484) at resolver.resolve.then.catch (indexOP.js:30572)

csuwildcat commented 5 years ago

I don't believe this implementation will be able to run in browsers, if that's what this issue is intended to highlight.

logangirvin commented 5 years ago

The only instance of fetch is in the http-resolver which is used externally for full authenticating flows (so larger issues, it should probably be moved into did-typescript-common), but this component is interchangable so a browser compliant window.fetch varient of the exact same code should resolve this in the immediate case.