Remote.js fetch changes cause issue with previously working code in browser #6527
Closed
5 tasks done
Labels
auto:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
remote.js:284 Uncaught (in promise) TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
at RemoteRunnable.post (remote.js:284:21)
at RemoteRunnable._invoke (remote.js:298:37)
at RemoteRunnable._callWithConfig (base.js:216:34)
at async work (Thinky.tsx:200:21)
Description
Previously this code was working, but in updating to latest langchain, i see that there is a new implementation of Remote.js that includes the ability to override the fetchImplementation:
This seems to have a similar issue:
https://stackoverflow.com/questions/44720448/fetch-typeerror-failed-to-execute-fetch-on-window-illegal-invocation
So it's seems the issue comes from taking fetch, in a browser context, and attaching it to a different base context, other than window.
I think the issue could be solved by adjusted the base setting of fetchImplementation to:
System Info
Deno 1.45.5
langchainjs/core 0.2.23
The text was updated successfully, but these errors were encountered: