I'm using .jurisdiction("eu") on Durable Object namespaces and wanted to use the pattern described in #4745 and implmented in #4763 , passing undefined in local dev where workerd doesn't support jurisdiction:
const jurisdiction = env.WORKER_ENV ? "eu" : undefined;
env.MY_DO.jurisdiction(jurisdiction);
This works at runtime but fails TypeScript type checking because the generated types still require DurableObjectJurisdiction and don't accept undefined.
declare abstract class DurableObjectNamespace<T extends Rpc.DurableObjectBranded | undefined = undefined> {
newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
idFromName(name: string): DurableObjectId;
idFromString(id: string): DurableObjectId;
get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub<T>;
jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace<T>;
}
type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
interface DurableObjectNamespaceNewUniqueIdOptions {
jurisdiction?: DurableObjectJurisdiction;
}
Had Claude Code look into it and it suspects the JSG_TS_OVERRIDE blocks in actor.h weren't updated to match the C++ signature change from this PR.
I'm using
.jurisdiction("eu")on Durable Object namespaces and wanted to use the pattern described in #4745 and implmented in #4763 , passingundefinedin local dev where workerd doesn't support jurisdiction:This works at runtime but fails TypeScript type checking because the generated types still require
DurableObjectJurisdictionand don't acceptundefined.Had Claude Code look into it and it suspects the JSG_TS_OVERRIDE blocks in actor.h weren't updated to match the C++ signature change from this PR.