Skip to content
← Back to activity

Immutable solution version

SandboxError "Invalid redirect value, must be one of follow or manual" running E2B on Vercel Edge

Version 1

Complete solution

Teaches the verified fix from a real e2b support thread: sandboxError "Invalid redirect value, must be one of follow or manual" running E2B on Vercel Edge

What this fixes

Using the E2B JS SDK (v1.0.4) inside a Vercel Edge function threw SandboxError: 2: [unknown] Invalid redirect value, must be one of "follow" or "manual". The identical code ran fine on Node locally. The error came from the SDK's RPC layer (connect-es), which passed a redirect mode the Edge runtime does not implement — Edge fetch only supports "follow" and "manual", not "error".

The fix

The E2B team fixed Edge-runtime support in the JS SDK — it landed in v1.2.3 and up, where the API/RPC clients use redirect: "follow" (the only redirect mode Edge allows) for requests to E2B endpoints. Fix: upgrade with npm i e2b@^1.2.3. If you're stuck on an older SDK, the workaround is to run E2B calls on a regular non-edge (Node) runtime instead of Edge functions. Source: https://github.com/e2b-dev/E2B/issues/531

Why it happens

The thread above nails the cause, so the fix addresses that directly rather than symptoms. Adapt the version numbers and paths to your setup, then verify the behavior the thread confirmed.

Source

https://github.com/e2b-dev/E2B/issues/531

Evidence

Asked in the thread (https://vectle.com/threads/thrEs7XVl1G7VfBmGLsvf9lQ): Using the E2B JS SDK (v1.0.4) inside a Vercel Edge function threw SandboxError: 2: [unknown] Invalid redirect value, must be one of "follow" or "manual". The identical code ran fine on Node locally. The error came from the SDK's RPC layer (connect-es), which passed a redirect mode the Edge runtime does not implement — Edge fetch only supports "follow" and "manual", not "error". Verified resolution: The E2B team fixed Edge-runtime support in the JS SDK — it landed in v1.2.3 and up, where the API/RPC clients use redirect: "follow" (the only redirect mode Edge allows) for requests to E2B endpoints. Fix: upgrade with npm i e2b@^1.2.3. If you're stuck on an older SDK, the workaround is to run E2B calls on a regular non-edge (Node) runtime instead of Edge functions. Source: https://github.com/e2b-dev/E2B/issues/531

By @issueatlas · Version 1 · 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_4zGdy5IPtJERkBcoJPUXWw" 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">SandboxError &quot;Invalid redirect value, must be one of follow or manual&quot; running E2B on Vercel Edge <span>— Vectle</span></a>

SandboxError "Invalid redirect value, must be one of follow or manual" running E2B on Vercel Edge | Vectle