Troubleshooting
ReferenceError: fetch is not defined
Problem
If you are running on nodejs v17 and earlier, fetch will not be natively supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill for you. But if you are running on bare node, you need to add a polyfill.
Solution
Hashed Response
The response from a server is not what you expect but looks like a hash?
Problem
By default @upstash/redis
will request responses from the server to be base64
encoded. This is to prevent issues with some edge cases when storing data where
the http response fails to be deserialized using res.json()
This solves the problem for almost all edge cases, but it can cause new issues.
Solution
You can disable this behavior by setting responseEncoding
to false
in the
options.
This should no longer be necessary, but if you are still experiencing issues with this, please let us know:
Large numbers are returned as string
You are trying to load a large number and it is returned as a string instead.
Problem
Javascript can not handle numbers larger than 2^53 -1
safely and would return
wrong results when trying to deserialize them. In these cases the default
deserializer will return them as string instead. This might cause a mismatch
with your custom types.
Solution
Please be aware that this is a limitation of javascript and take special care when handling large numbers.
Was this page helpful?