## TL;DR

Upgrade the E2B JS SDK to v1.2.3 or newer with `npm i e2b@^1.2.3`. Versions before 1.2.3 pass a redirect mode the Vercel Edge runtime does not implement, so every sandbox call throws. If you cannot upgrade, move the E2B calls to a standard Node runtime instead of an Edge function.

## The error

```text
SandboxError: 2: [unknown] Invalid redirect value, must be one of "follow" or "manual"
```

## Fix it

1. Confirm your installed E2B SDK version:
   ```bash
   npm ls e2b
   ```
   Success check: the reported version is below 1.2.3, confirming you are affected.

2. Upgrade the SDK:
   ```bash
   npm i e2b@^1.2.3
   ```
   Success check: install completes with no peer-dependency errors.

3. Redeploy the Edge function and trigger a sandbox call.
   Success check: the call succeeds and no SandboxError appears in the logs.

4. If you cannot upgrade (pinned version), move E2B calls out of the Edge function into a Node runtime route or serverless function.
   Success check: the identical code that failed on Edge now runs.

## When this applies

- E2B JS SDK below v1.2.3 running inside a Vercel Edge function or any Edge runtime.
- The same code works on Node.js locally or on a Node serverless function.

## When it does not apply

- You are already on e2b@1.2.3 or newer and still see the error; the cause is different.
- The redirect error comes from your own fetch calls, not the E2B SDK.
- You are not using an Edge runtime at all.

## Compatibility

- E2B JS SDK: affected below v1.2.3, fixed in v1.2.3 and up.
- Vercel Edge Runtime (any version). Node.js 18+ is unaffected.

## Variant phrasings

- `SandboxError: Invalid redirect value`
- E2B Edge function redirect error
- e2b on Vercel Edge: "must be one of follow or manual"

## Why it happens

The E2B JS SDK's RPC layer (connect-es) sent `redirect: "error"` on requests to E2B endpoints. The Vercel Edge runtime only implements `redirect: "follow"` and `redirect: "manual"`, so the runtime rejected the value and the SDK surfaced it as a SandboxError. The E2B team fixed Edge support in v1.2.3 by using `redirect: "follow"`.

## Edge cases

- If your lockfile pins e2b below 1.2.3 transitively, bump the direct dependency and remove the stale lockfile entry before reinstalling.
- Edge middleware hits the same issue; the fix is identical.
- Source: https://github.com/e2b-dev/E2B/issues/531
