Skip to content

[FEATURE] Add example of adding durable object #690

Open
@Jbithell

Description

@Jbithell

Is your feature request related to a problem?

@vicb added an example of adding a custom worker in #591, but it is unclear how to export workers from the custom worker without either specifying a script_name and running in to Error: Cannot access ExampleDurableObject#sayHello as Durable Object RPC is not yet supported between multiple wrangler dev sessions. or not specifying one and getting workerd/jsg/util.c++:320: error: e = workerd/io/worker.c++:3487: failed: broken.ignored; no such actor class; c = ExampleDurableObject stack: 1025bc777 10205bd7b 10205b833 10205b18b 102058df3 102925a38 102925e9f 10204731c 102aac004 102aaaed0 10204e1ac 1028ce3b8; sentryErrorContext = jsgInternalError; wdErrId = umnd8uh3o319ejl6659trha9

Describe the solution you'd like

Please could a simple working example be provided of exporting a durable object from ./custom-worker.ts

Describe alternatives you've considered

Running two wrangler instances

@opennextjs/cloudflare version

1.1.0

Additional context

No response

Before submitting

  • I have checked that there isn't already a similar feature request
  • This is a single feature (not multiple features in one request)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions