I am having issues connecting to a Vercel KV store I’ve recently setup. I have done the following steps…
Created a Vercel kv store via Vercel’s dashboard
Connected the KV store to an existing project hosting on Vercel
Used the Vercel CLI to pull environment variables into an .env.development.local file. I also have the four main environment variables for KV in an .env and a .env.local file (all the same values)
Hi @brandon-codeswitchco! It looks like you’ve imported kv from @vercel/kv but also assigned a const kv with createClient. That might be causing a conflict. The Vercel KV Quickstart includes some examples to help you get it set up.
I have a couple of other ideas to try if changing the import or const name didn’t solve it. If you’re not using vercel dev to run the project, give that a try. You can also try logging some of the variables from your .env.* files. Do they exist with the expected values?
Hey @amyegan, thanks for the feedback. Running vercel dev did the trick, but what’s weird is that I just stopped the localhost server and ran yarn dev again, and now it’s working there as well. Not sure what happened, but at least it’s working.
Do you know of any issues with intermittent KV access from other users by chance?
I’m glad it’s working for you! I have not seen any intermittent KV connection errors lately, but I’ll watch for them to make sure there isn’t a larger issue.