Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit d160bc9

Browse files
committed
fix(cf): force worker to act as runner (#1194)
1 parent 7d637f4 commit d160bc9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/drivers/cloudflare-workers/src/actor-handler-do.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,13 @@ interface LoadedActor {
5151

5252
export function createActorDurableObject(
5353
registry: Registry<any>,
54-
runConfig: RunConfig,
54+
rootRunConfig: RunConfig,
5555
): DurableObjectConstructor {
5656
const globalState = new CloudflareDurableObjectGlobalState();
5757

58+
// Configure to use the runner role instead of server role
59+
const runConfig = Object.assign({}, rootRunConfig, { role: "runner" });
60+
5861
/**
5962
* Startup steps:
6063
* 1. If not already created call `initialize`, otherwise check KV to ensure it's initialized

packages/drivers/cloudflare-workers/src/handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ export function createServer<R extends Registry<any>>(
5252

5353
// Create config
5454
const runConfig = {
55+
...config,
56+
// The worker acts as a server and doesn't run actors
57+
role: "server",
5558
driver: {
5659
name: "cloudflare-workers",
5760
manager: () => new CloudflareActorsManagerDriver(),
5861
// HACK: We can't build the actor driver until we're inside the Durable Object
5962
actor: undefined as any,
6063
},
6164
getUpgradeWebSocket: () => upgradeWebSocket,
62-
...config,
6365
} satisfies RunConfig;
6466

6567
// Create Durable Object

0 commit comments

Comments
 (0)