@cloudflare/sandbox
1.0.3 · 22 Oct 2026Apache-2.02.1M / weekRepositoryHomepagenpmAtom feed
0.12.14 is the newest release of 0.12.x.
In short
11 fixed
Release note
Patch Changes
Fix
mountBucket()breaking an existing mount when a second call for the same mount path fails with "already in use". The existing mount now stays mounted and usable.Keep streaming
exec()alive while a command is quiet, and enforce itstimeout. Quiet commands were cut off after about four minutes on the HTTP transport and five on WebSocket. The timeout was ignored on those transports, and on every transport for commands that run in a session. Requires the matching container image.Keep R2 binding and credential-proxy bucket mounts working when the Sandbox Durable Object restarts while its container keeps running. The mounts used to stay listed but fail every read and write with
EIOuntilmountBucket()was called again.Fix
createOpencodeServer()andcreateOpencode()waiting for the full three-minute startup timeout whenOPENCODE_SERVER_PASSWORDis set. When the password is passed inenv, the client returned bycreateOpencode()now authenticates with it.Create the s3fs password file for
mountBucket()with mode 0600 from the start. The file used to be readable by other users in the container until a chmod a moment later, long enough for a non-root process to open it and read the bucket credentials. Upgrade the container image together with the SDK to close the gap; with an older image, mounts work as before.Answer a preview request with
502when the app's port in the container fails, for example because nothing listens on it or it closes the connection, and log the original error. Previously the error escaped the Sandbox,proxyToSandbox()answered500 Proxy routing error, and the log blamed a platform runtime update.Forward WebSocket upgrades on preview URLs with
Host: localhost:<port>, like every other preview request. Dev servers that check theHostheader, such as Vite, no longer reject HMR connections. The public hostname is still inX-Forwarded-Host.Keep preview URLs and tunnels working on the RPC transport after the control connection reconnects. The connection closes after 1 second without calls, and the next call used to rerun the sandbox's start handling even though the container was still running. Preview URLs then returned
410 STALE_PREVIEW_URL,getExposedPorts()returned an empty list, quick tunnels disappeared fromtunnels.list(), andtunnels.get()could fail with "Tunnel recovery attempts were exhausted".Stop the first call on the RPC transport from failing when Cloudflare can't provide a container right away. The call now keeps waiting for the container within its retry window.
Stop the container server from crashing with
ENOENT: no such file or directory, watch '…/<id>.log.stderr'while commands run. The crash killed every process in the container. Update the container image to pick up this fix.tunnels.get()on the RPC transport now reports the real tunnel error, such ascloudflaredfailing to start or missing from the image, instead of "Tunnel recovery attempts were exhausted". It also no longer leaves a port stuck after giving up: acloudflaredleft running from an earlier attempt is stopped and replaced. Replacing it needs the matching container image.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.