Worker Unable to Connect Env Variables

I am following this tutorial https://developers.cloudflare.com/vectorize/get-started/intro/#2-create-an-index to create a worker and access my index created. However when I tried to run part 4 of the tutorial, it gives me an error and I found out that my env is null although I followed exactly how the tutorial set everything up. I used two other devices to try to run the code locally but both gave me same error. Does anyone know why this is the case? Thank you so much.
Introduction to Vectorize · Vectorize
Vectorize is currently in public beta and is enabled for all developers on Workers Paid plans. During the beta, you may run into bugs and instability …
1 Reply
Adam
Adam8mo ago
Can you try running the code with wrangler dev --remote ? My guess is that you're running wrangler locally with wrangler dev and the index you created in step 2 only exists remotely.