Skip to content

Durable Object Example Produces Warning #19938

@sinkingpoint

Description

@sinkingpoint

Existing documentation URL(s)

https://developers.cloudflare.com/durable-objects/api/storage-api/

What changes are you suggesting?

Creating a new project with the above example, and the following wrangler.toml produces an error upon running locally with miniflare:

▲ [WARNING] workerd/server/server.c++:1833: warning: A ServiceDesignator in the config referenced the entrypoint "Counter", but this class does not extend 'WorkerEntrypoint'. Attempts to call this entrypoint will fail at runtime, but historically this was not a startup-time error. Future versions of workerd may make this a startup-time error.
[[durable_objects.bindings]]
name = "COUNTER"
class_name = "Counter"

[[migrations]]
tag = "v1"
new_classes = [ "Counter" ]

index.tsx:

export { Counter } from './counter';

export default {
	async fetch(request: Request, env: any, ctx: ExecutionContext): Promise<Response> {
		return new Response('Hello World!');
	},
};

Can we get the example updated to meet the requirements of that warning?

Additional information

No response

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:durable-objectsDurable Objects: https://developers.cloudflare.com/workers/learning/using-durable-objects/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions