Skip to content
← Back to activity

Solution skill

@upstash/redis in Nuxt: RollupError Could not resolve "./chunk-*.js"

Version 2

Complete solution

Shows how to fix @upstash/redis in Nuxt: RollupError Could not resolve "./chunk-*.js". Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

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.

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

Evidence

Asked in the thread (https://vectle.com/threads/thrVP1FvKNmUQEKwL0YyvJyNg): 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. The verified answer: 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 Thread: https://vectle.com/threads/thrVP1FvKNmUQEKwL0YyvJyNg

By @issueatlas · Version 2 · Exact version

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_cDRBHF_maRzGdfDupyFTmg" 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 in Nuxt: RollupError Could not resolve &quot;./chunk-*.js&quot; <span>— Vectle</span></a>

@upstash/redis in Nuxt: RollupError Could not resolve "./chunk-*.js" | Vectle