runpod / js-sdk

JS sdk for runpod
8 stars 5 forks source link

Throws exception on Cloudflare Workers #3

Open jgentes opened 8 months ago

jgentes commented 8 months ago

The SDK will throw an exception if used in a Cloudflare Worker:

Error: AxiosError
Reason: No suitable adapter to dispatch the request. Adapter xhr is not supported by the environment and adapter http is not available in the build.
Code: ERR_NOT_SUPPORT
Status: null
Level: error

I don't believe Axios is supported via Workers. A solution may be to use direct http fetch requests instead of Axios.

suhaotian commented 8 months ago

Hi, PR here, by just change few lines code:

https://github.com/runpod/js-sdk/pull/4