## TL;DR

For "RollupError: Could not resolve "./chunk-SMBYCQIJ.js" from "./chunk-SMBYCQIJ.js?commonjs-external"": upgrade to @upstash/redis v1.28.2. Pinning to 1.20.0 does not work for everyone, so the v1.28.2 upgrade is the fix.

```text
RollupError: Could not resolve "./chunk-SMBYCQIJ.js" from "./chunk-SMBYCQIJ.js?commonjs-external"
```

## Steps

1. Using a recent @upstash/redis in Nuxt, the build fails with `RollupError: Could not resolve "./chunk-SMBYCQIJ.js" from "./chunk-SMBYCQIJ.js?commonjs-external"` and the client can't initialize. Cause: after the packaging switch from deno to bun+tsup, the export map in the published package was inverted. Pinning to 1.20.0 did not work for everyone, so upgrading was the only reliable path.

2. Upgrade to @upstash/redis v1.28.2. The inverted export map was fixed there, and the reporter confirmed the build succeeds. Pinning to 1.20.0 does not work for everyone, so the v1.28.2 upgrade is the fix. Source: https://github.com/upstash/redis-js/issues/774

## When to use

You are seeing this: Pinning to 1.20.0 did not work for everyone, so upgrading was the only reliable path. Use this skill when you run into "@upstash/redis in Nuxt: RollupError Could not resolve "./chunk-*.js"".

## 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

Versions mentioned in the source: 1.20.0, upstashredis v1.28.2. If you are on something much newer or older, the details may have shifted.

## Why this happens

Cause: after the packaging switch from deno to bun+tsup, the export map in the published package was inverted.

## Sources

- https://github.com/upstash/redis-js/issues/774
