@cloudflare/containers
0.3.7 · 4 Jun 2026MIT OR Apache-2.03M / weekRepositoryHomepagenpmAtom feed
46 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 0.3.x · latest line
0.3.7
4 Jun 2026Prevent startup and stop handling races from persisting a stopped state for a running container.
0.3.6
1 Jun 2026Use
IdentityTransformStreamwhen proxying deferred HTTP response bodies.Remove noisy logs emitted while checking container and port readiness.
0.3.5
27 May 2026Use the canonical
AlarmInvocationInfotype from@cloudflare/workers-typesfor thealarm()parameter instead of an inline type. This is a no-op for users (the shape is identical), but keeps the override aligned with the Durable Object base class signature.Refreshed the
examples/projects:No changes to the published library API.
Add return types to exported functions and public methods to satisfy ESLint and improve type checking.
Patch Changes
Use the canonical
AlarmInvocationInfotype from@cloudflare/workers-typesfor thealarm()parameter instead of an inline type. This is a no-op for users (the shape is identical), but keeps the override aligned with the Durable Object base class signature.Refreshed the
examples/projects:All examples now use the latest TypeScript, Vitest, and Wrangler, and target a current Workers
compatibility_date.Worker types are generated by
wrangler types, matching current Cloudflare guidance.The
examples/timeout/snippet is now a fully runnable example.Integration tests now run on arm64 hosts (e.g. Apple Silicon) and reliably clean up after themselves.
No changes to the published library API.
Add return types to exported functions and public methods to satisfy ESLint and improve type checking.
Clarify the license for this library matches that of
@cloudflare/workers-sdk, which is dual licensed under either MIT OR Apache-2.0.Tighten the return type of
Container#onErrorfromanytounknown. Subclasses that overrideonErrorcan still return any value. This should be a no-op for most users.Preserve original errors as
causewhen wrapping abort/timeout errors during container startup, making it easier to debug the underlying failure.Reset container state after failed startup or terminal monitor errors, avoid stale monitor callbacks updating newer instances, and apply configured constructor startup options.
0.3.4
11 May 2026Fix a race in
Containerwhere concurrentcontainer.fetchcalls to a cold container could throw"start() cannot be called on a container that is already running.".Ensure pending stop events are processed when the persisted container lifecycle state is still
runningbut the underlying container has already exited.Migrate the root unit test suite from Jest to Vitest and add a
test:unitscript for runningsrc/testsdirectly.Fix subclass
sleepAfteroverrides being ignored during the initial activity timeout setup. Previously, the baseContainerconstructor calledrenewActivityTimeout()insideblockConcurrencyWhile()before subclass class-field initializers ran, so the firstsleepAfterMswas always computed from the base default ('10m') regardless of whether the subclass declaredsleepAfter = '2h'. A container could then be killed by the activity timeout before the subclass's longer window took effect on the nextrenewActivityTimeoutcall. Declarations like:class BigContainer extends Container { sleepAfter = '2h'; }are now honored from the very first alarm check.
Patch Changes
Fix a race in
Containerwhere concurrentcontainer.fetchcalls to a cold container could throw"start() cannot be called on a container that is already running.".Ensure pending stop events are processed when the persisted container lifecycle state is still
runningbut the underlying container has already exited.Migrate the root unit test suite from Jest to Vitest and add a
test:unitscript for runningsrc/testsdirectly.Fix subclass
sleepAfteroverrides being ignored during the initial activity timeout setup. Previously, the baseContainerconstructor calledrenewActivityTimeout()insideblockConcurrencyWhile()before subclass class-field initializers ran, so the firstsleepAfterMswas always computed from the base default ('10m') regardless of whether the subclass declaredsleepAfter = '2h'. A container could then be killed by the activity timeout before the subclass's longer window took effect on the nextrenewActivityTimeoutcall. Declarations like:class BigContainer extends Container { sleepAfter = '2h'; }are now honored from the very first alarm check.
Preserve Cloudchamber startup rate-limit errors in the Containers helper and return HTTP 429 from
containerFetch()when startup is rate limited.
0.3.3
21 Apr 2026Attach custom labels to your containers to help with observability and attribution. Set a
labelsproperty on yourContainersubclass, or passlabelsin thestartOptionsargument tostart()/startAndWaitForPorts(), and tag containers by tenant, environment, feature flag, canary cohort, or any other dimension you want to track. In local development, labels are visible on the underlying Docker container viadocker inspect.class MyContainer extends Container { labels = { tenant: 'acme', env: 'prod' }; }
0.3.2
15 Apr 2026Preserve response headers when proxying WebSocket upgrades through
Container.fetch().
0.3.1
15 Apr 2026Remove debug
console.log(props)statement fromContainerProxyinitialization
0.3.0
9 Apr 2026Opt in to interceptOutboundHttps when interceptHttps = true
- 0.2.x
0.2.4
7 Apr 2026Fix
containerFetch()throwing on proxied bodyless responses by skipping response reconstruction whenResponse.bodyisnull.
0.2.3
6 Apr 2026Handle Blob WebSocket messages by converting to ArrayBuffer before forwarding between client and container
0.2.2
31 Mar 2026Activity tracking refreshes timeout if inflight request instead of depending on alarm polling
0.2.1
30 Mar 2026Start tracking activity by piping the response body to a transform stream and proxying the websocket
0.2.0
23 Mar 2026Add support to specify outbound hooks in container class (experimental)
- 0.1.x
0.1.1
26 Feb 2026Fix operator precedence in port-ready timeout retry calculation
Update container default
EnvtoCloudflare.Env
0.1.0
15 Jan 2026Add pingEndpoint to configure the ping URL of the container class
Add custom ping endpoint
- 0.0.x
0.0.31
12 Dec 2025Correctly sync state when calling
stop()
0.0.30
29 Oct 2025Calling
stop()on a container that is not running should not send another stop signal
0.0.29
24 Oct 2025Miscellaneous minor fixes and improvements to starting containers and port checking.
Fix racy condition where we would try and start containers that are running
0.0.28
3 Sep 2025Add function overload to startAndWaitForPorts()
You can now use
startAndWaitForPorts({startOptions: {envVars: {FOO:"BAR"}}})instead ofstartAndWaitForPorts(undefined, {}, {envVars: {FOO:"BAR"}}), although that is still supported.
0.0.27
29 Aug 2025Add
startOptionstostartAndWaitForPorts()This lets you configure env vars, the entrypoint command, and internet access when you call
startAndWaitForPorts. Previously this was only supported onstart.Use default port by default when making fetch requests to containers. this was breaking local dev as we would check the port of the host url, rather than the port the container was listening on. this was not an issue in production, as all ports are exposed there.
Patch Changes
Add
startOptionstostartAndWaitForPorts()This lets you configure env vars, the entrypoint command, and internet access when you call
startAndWaitForPorts. Previously this was only supported onstart.Use default port by default when making fetch requests to containers. this was breaking local dev as we would check the port of the host url, rather than the port the container was listening on. this was not an issue in production, as all ports are exposed there.
0.0.1 – 0.0.2626 releases without a noteShow each
- 0.0.2621 Aug 2025no note
- 0.0.2524 Jul 2025no note
- 0.0.2418 Jul 2025no note
- 0.0.2315 Jul 2025no note
- 0.0.2211 Jul 2025no note
- 0.0.2111 Jul 2025no note
- 0.0.2010 Jul 2025no note
- 0.0.193 Jul 2025no note
- 0.0.182 Jul 2025no note
- 0.0.171 Jul 2025no note
- 0.0.1630 Jun 2025no note
- 0.0.1530 Jun 2025no note
- 0.0.1430 Jun 2025no note
- 0.0.1324 Jun 2025no note
- 0.0.1224 Jun 2025no note
- 0.0.1123 Jun 2025no note
- 0.0.1023 Jun 2025no note
- 0.0.94 Jun 2025no note
- 0.0.820 Jun 2025no note
- 0.0.718 Jun 2025no note
- 0.0.618 Jun 2025no note
- 0.0.518 Jun 2025no note
- 0.0.46 Jun 2025no note
- 0.0.34 Jun 2025no note
- 0.0.24 Jun 2025no note
- 0.0.12 Jun 2025no note
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.