RPC Durable Object not working

Can somebody help me finding out why my RPC Durable Object is not working (locally, newest wrangler)? I basically have this (simplified) setup:
export class Example extends DurableObject {
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
// ...
}

async fetch(request: Request): Promise<Response> {
// ...
}

async create(test: string) {
return test + "1";
}
}
export class Example extends DurableObject {
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
// ...
}

async fetch(request: Request): Promise<Response> {
// ...
}

async create(test: string) {
return test + "1";
}
}
When I try to call the create function now, it fails with TypeError: example.create is not a function. Again, simplified:
const objectId = c.env.EXAMPLE.idFromName("test");
const example = c.env.EXAMPLE.get(objectId);
const response = await example.create("example");
const objectId = c.env.EXAMPLE.idFromName("test");
const example = c.env.EXAMPLE.get(objectId);
const response = await example.create("example");
1 Reply
Fabian
Fabian6mo ago
Found out the problem: Had to update the compatibility date in my wrangler.toml - now it works as expected. The warning regarding this was only showing up during a remote dev session, not locally. Not sure if something on my side prevented it from showing up, but thanks to the warning in the remote dev session I found it out.
Want results from more Discord servers?
Add your server