hub-node-core icon indicating copy to clipboard operation
hub-node-core copied to clipboard

Fetch invocation error when running on non-node client

Open codeglobally opened this issue 7 years ago • 2 comments

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)

codeglobally avatar Oct 31 '18 08:10 codeglobally

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

csuwildcat avatar Nov 01 '18 02:11 csuwildcat

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.

logangirvin avatar Nov 01 '18 02:11 logangirvin