I have my blog running on cloudflare workers + astro.
Now I wanted to use durable objects in one of my server rendered endpoints - and according to the @astro/cloudflare documentation, I should be defining a worker entrypoint like so in the adapter's config:
workerEntryPoint: {
path: 'src/worker.ts',
namedExports: ['MyDurableObject'],
},
and it gives an example of exactly this on the same page.
So I did that, and I also added this to my wrangler.jsonc:
"durable_objects": {
"bindings": [
{
"name": "MY_DURABLE_OBJECT",
"class_name": "MyDurableObject",
},
],
},
However, when i start the dev server, I get this error:
@arnorhs/astro:dev: workerd/server/server.c++:1955: warning: A DurableObjectNamespace in the config referenced the class "MyDurableObject", but no such Durable Object class is exported from the worker. Please make sure the class name matches, it is exported, and the class extends 'DurableObject'. Attempts to call to this Durable Object class will fail at runtime, but historically this was not a startup-time error. Future versions of workerd may make this a startup-time error.