I'm getting the following error locally

I'm getting the following error locally
✘ [ERROR] Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'insert')
env.VECTORIZE.insert(vectors)
env.VECTORIZE.insert(vectors)
I'm running npm run dev --experimental-vectorize-bind-to-prod and wrangler is showing
- Vectorize Indexes:
- VECTORIZE: <MY_INDEX> [connected to remote resource]
- Vectorize Indexes:
- VECTORIZE: <MY_INDEX> [connected to remote resource]
on start up?
4 Replies
garvitg
garvitg3mo ago
Hey @7777777. Thanks for checking in.
What does the vectors var look like? Also, are you facing this issue consistently? Could you please compare your code against the example given in https://developers.cloudflare.com/vectorize/get-started/intro/? Feel free to share the code in this thread or over DM if you'd like additional support for this issue.
Cloudflare Docs
Introduction to Vectorize
Vectorize is Cloudflare's vector database. Vector databases allow you to use machine learning (ML) models to perform semantic search, recommendation, classification and anomaly detection tasks, as well as provide context to LLMs (Large Language Models).
7777777
7777777OP3mo ago
Yeah - I don't think it's a code issue, it was a binding issue. I figured it out though, I was running npm run dev --experimental-vectorize-bind-to-prod - and the flag wasn't getting passed to wrangler.
beingmudit [WePlayDOS]
But it is still a mixed mode right? I mean calls are going to CF only.
yevgen
yevgen3mo ago
correct, no support for local mode

Did you find this page helpful?