Skip to content

How to use event.waitUntil in denoflare? #9

Discussion options

You must be logged in to vote

In general, for module-based Cloudflare workers, a third argument context is passed to fetch, which has the waitUntil method. Module-based workers have no event.

Denoflare includes a type called ModuleWorkerContext for this here with an explanation, but it is not Denoflare specific, just providing types for what Cloudflare already does.

I'm assuming you're trying to run this locally via denoflare serve? It should implement that 3rd arg so waitUntil should work in general. Just pass it down from your fetch method.

I think the error you're receiving is cloning the response. Denoflare reimplements Response when running locally, and supports cloning with an ArrayBuffer body, but not a stream …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bebraw
Comment options

@johnspurlock-skymethod
Comment options

@bebraw
Comment options

@bebraw
Comment options

@johnspurlock-skymethod
Comment options

Answer selected by bebraw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants