upstash / vector-js

Upstash Vector JS SDK
https://docs.upstash.com/vector
MIT License
43 stars 6 forks source link

"The 'cache' field on 'RequestInitializerDict' is not implemented" in live cloudflare worker #23

Closed nicougou closed 7 months ago

nicougou commented 7 months ago

I believe the js sdk is suffering from the same issue as the redis sdk when it comes to cloudflare workers :

https://github.com/upstash/upstash-redis/issues/338

Here is the error i get :

✘ [ERROR] Error: The 'cache' field on 'RequestInitializerDict' is not implemented.

Any chance the same fix could be applied to the vector-js sdk ?

joschan21 commented 7 months ago

Hey! We've implemented a fix for this a couple days ago, but it hasn't been documented yet. When creating your index, pass cache: false to it.

Like this: const Index = new Index({ url: '...', token: '...', cache: false })

This will disable the caching option and work on Cloudflare Worker runtime. Cheers, I'll get this documented soon