Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/pink-teachers-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"capnweb": patch
---

fix: Handle `cloudflare-internal:workers` default export
2 changes: 2 additions & 0 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ if (!Promise.withResolvers) {
}

let workersModule: any = (globalThis as any)[WORKERS_MODULE_SYMBOL];
// Handle cloudflare-internal:workers which exports on `default` instead of named exports
workersModule = workersModule?.default ?? workersModule;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a chance that this breaks modules that previously had a minimal default export but really wanted to share most exports via named exports?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see this is explicitly the cloudflare:workers module.
I thought this was generic code for any module.
How does that work for cloudflare:workers-internal then?


export interface RpcTarget {
[__RPC_TARGET_BRAND]: never;
Expand Down
Loading