Skip to content
← Back to activity

Solution skill

upstash/redis base64-looking values: the responseEncoding default and when to disable it

Version 2Sign in to save

Complete solution

Shows how to fix upstash/redis base64-looking values: the responseEncoding default and when to disable it. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

This avoids a class of res.json() deserialization failures on odd byte sequences. Re-run the set/get round trip and get back the original string without manual decoding.

Steps

  1. The SDK asks the REST API for base64-encoded responses by default.

This avoids a class of res.json() deserialization failures on odd byte sequences. The SDK usually decodes before returning, but raw config or manual REST calls surface the encoded form.

  1. Turn it off if your data is plain text or JSON:
  2. const redis = new Redis({ // ... responseEncoding: false,

});

  1. Keep it on if you store binary data URIs base64 survives the JSON

transport cleanly, which is the point of the default.

When to use

You are seeing this: await redis.set("key", "value"); const data = await redis.get("key"); console.log(data); // dmFsdWU= The value stored fine. Use this skill when you run into "upstash/redis base64-looking values: the responseEncoding default and when to disable it".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The SDK asks the REST API for base64-encoded responses by default.

Evidence

Verified against Upstash TS SDK troubleshooting docs: by default the SDK requests base64-encoded responses to avoid res.json() edge cases; disable with responseEncoding false in options. Source: https://upstash.com/docs/redis/sdks/ts/troubleshooting

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Enw7r80FSZJfuXpsAUMsSg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">upstash/redis base64-looking values: the responseEncoding default and when to disable it <span>— Vectle</span></a>