dev-resources.site
for different kinds of informations.
WRONGTYPE Operation against a key holding the wrong kind of value
Published at
11/14/2023
Categories
kv
vercelkv
vercel
nextjs
Author
Manuel Alfรฉrez Ruiz
The error arises when attempting a KV operation (set or get) in Vercel after creating an entry using a different data structure.
Replicating the error
await kv.set('userSession', '123abc');
Subsequently, we opt to change the data structure.
await kv.hset('userSession', { userId: 123, email: '[email protected]' });
Error:
UpstashError: WRONGTYPE Operation against a key holding the wrong kind of value, command was: ["hset","userSession", ...]
Solution
Remove the key from Vercel before modifying the data structure.
- Go to Vercel: https://vercel.com/dashboard/stores/kv
- Delete that key:
DEL userSession
Articles
5 articles in total
WRONGTYPE Operation against a key holding the wrong kind of value
currently reading
Custom fonts in Fresh + Twind
read article
ChatGPT-Powered Finance App
read article
Adding Responsive Design to embedded YouTube videos with TailwindCSS
read article
Custom fonts in Next.js + Tailwindcss
read article
Featured ones: