Skip to content

Example rate limit queue article gives a type error with latest wrangler typegen #26780

@jms301

Description

@jms301

Existing documentation URL(s)

https://developers.cloudflare.com/queues/tutorials/handle-rate-limits/#related-resources

What changes are you suggesting?

If you follow this guide now you'll get a type error on the queue consumer function

Type '(batch: MessageBatch<Message>, env: Env) => Promise<void>' is not assignable to type 'ExportedHandlerQueueHandler<Env, unknown>'. Types of parameters 'batch' and 'batch' are incompatible. Type 'MessageBatch<unknown>' is not assignable to type 'MessageBatch<Message>'. Type 'unknown' is not assignable to type 'Message'.

Additional information

I couldn't find any clear explanation of how to get type checking to work for queue messages easily.

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:queuesCloudflare Queues: https://developers.cloudflare.com/queues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions