Repository navigation
Conversation
|
interesting, could you send me a repro of this? i've been playing around with alchemy build deployments into openorange as well |
|
ctx.storage just has partial support atm as well |
yes ofc hold on my clanker threw away the experiment lol |
sry took a while I have bad internet two repros, both on open-orange 1.0.3 from npm plain worker, no alchemy // src/index.js
import { DurableObject } from "cloudflare:workers";
export class Counter extends DurableObject {
// on cloudflare this is false: a class without a container sees undefined
hasContainer = this.ctx.container !== undefined;
async increment() {
const n = ((await this.ctx.storage.get("n")) ?? 0) + 1;
await this.ctx.storage.put("n", n);
return { n, hasContainer: this.hasContainer };
}
}
export default {
async fetch(request, env) {
return Response.json(await env.Counter.getByName("a").increment());
},
};// wrangler.jsonc
{
"name": "container-repro",
"main": "src/index.js",
"compatibility_date": "2026-11-01",
"durable_objects": { "bindings": [{ "name": "Counter", "class_name": "Counter" }] },
"migrations": [{ "tag": "v1", "new_sqlite_classes": ["Counter"] }]
}
the alchemy version alchemy hands each DO an Effect wrapper around i put it up as an example on an experiment branch of my alchemy fork, nice that you're poking at alchemy builds too, happy to compare notes. i also ran that example unpatched on this branch's build live, on rivet cloud and on a self-hosted engine, and it works on both. the plain repro under and yeah, this one only uses storage get/put so it didn't hit the partial parts |
On Cloudflare, a Durable Object that has no container sees
ctx.containerasundefined, so code can just check it. On Orange, reading it throws instead, which crashes the object before it starts.I ran into this during an experiment: seeing whether Workers built with alchemy (an Effect-based infra-as-code tool with a Cloudflare provider) run on Orange as they are. alchemy builds the Worker itself and hands each Durable Object an Effect version of
ctx. To build it, it copiesctx.containeralong with the other fields, which is fine on Cloudflare. On Orange that read threw, so every Durable Object failed to start and every call returnedguard.actor_stopped_while_waiting.ctx.containernow returnsundefinedin classes that wranglercontainersdoes not list, matching workerd.containerslists still get their container, unchanged.state.test.ts, the e2e state probe indurable-object-rpc-fetch.test.ts, the sandbox and Durable Objects internals docs, and the compat notes inmatrix.jsonandproducts.jsonare updated to match.With this change the test Worker (a Durable Object counter and KV) runs unchanged under
orange dev.