Not binding env variables

I have vectorize in wrangler.toml [[vectorize]] binding = "VECTORIZE_INDEX" index_name = "supermem-vector-1" but my env when i log it doesnt have vectorize_index. It is binding everything except vectorize. Not really sure how to debug this.
{ AI: Ai { fetcher: Fetcher {}, logs: [], options: {}, lastRequestId: null }, KV: KvNamespace {}, MY_QUEUE: WorkerQueue {} }
4 Replies
zegevlier
zegevlier6mo ago
Can you share your entire wrangler.toml file? The formatting in toml is a bit odd sometimes, so that might be causing issues Please make sure you put three ``` before and after the text, so it's formatted properly
like this
like this
``` like this ```
Mohan
Mohan6mo ago
name = "cf-ai-backend"
main = "src/index.ts"
compatibility_date = "2024-02-23"
compatibility_flags = ['nodejs_compat']

[[vectorize]]
binding = "VECTORIZE_INDEX"
index_name = "supermem-vector-1"

[ai]
binding = "AI"

[[queues.producers]]
queue = "batch-vector-queue"
binding = "MY_QUEUE"

[[queues.consumers]]
queue = "batch-vector-queue"

[[kv_namespaces]]
binding = "KV"
id = "37a90353da63401e84e20e71165531d0"
preview_id = "c58b6202814f4224acea97627d0c18aa"

[browser]
binding = "MYBROWSER"

[placement]
mode = "smart"
name = "cf-ai-backend"
main = "src/index.ts"
compatibility_date = "2024-02-23"
compatibility_flags = ['nodejs_compat']

[[vectorize]]
binding = "VECTORIZE_INDEX"
index_name = "supermem-vector-1"

[ai]
binding = "AI"

[[queues.producers]]
queue = "batch-vector-queue"
binding = "MY_QUEUE"

[[queues.consumers]]
queue = "batch-vector-queue"

[[kv_namespaces]]
binding = "KV"
id = "37a90353da63401e84e20e71165531d0"
preview_id = "c58b6202814f4224acea97627d0c18aa"

[browser]
binding = "MYBROWSER"

[placement]
mode = "smart"
Also thank you for that very quick reply also it shows me that the binding is present but i am not able to use it in env wrangler.toml changed... Your worker has access to the following bindings: - KV Namespaces: - KV: c58b6202814f4224acea97627d0c18aa - Queues: - MY_QUEUE: batch-vector-queue - Vectorize Indexes: - VECTORIZE_INDEX: supermem-vector-1 - Browser: - Name: MYBROWSER - AI: - Name: AI
zegevlier
zegevlier6mo ago
Hmm that looks correct as far as I can see. Are you running in local mode or remote mode? Local mode doesn't support vectorize
Mohan
Mohan6mo ago
local mode nooooo but it should till show the value right? actually yeh i am not using local flag. its remote
Want results from more Discord servers?
Add your server