Next.js Discord

Discord Forum

Vercel KV returns null on startup everytime.

Unanswered
Chinese perch posted this in #help-forum
Open in Discord
Avatar
Chinese perchOP
I'm using Vercel KV in my Nextjs app. I've noticed that despite the key being available in the storage, the KV library returns null when I start the dev server. It returns correct data after that until I restart the server. When I restart, it again does the same thing. Here is the sample code:
import { kv } from '@vercel/kv';
const accessTokenData = await kv.get('accessTokenData'); 
console.log(accessTokenData); // <--- null on first try, fetches correct data after that.

0 Replies