cloudflare / cloudflare/cloudflare-docs

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

Open
#26,780 4 comments 0 reactions 4 assignees Claimed by @mia303 View on GitHub
content:edit documentation product:queues stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### 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, env: Env) => Promise' is not assignable to type 'ExportedHandlerQueueHandler'.
Types of parameters 'batch' and 'batch' are incompatible.
Type 'MessageBatch' is not assignable to type 'MessageBatch'.
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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.