Worker getting canceled after first request

Hi!

I'm making a Discord bot on Workers, and it needs to defer the interaction. I'm doing a subrequest to defer, and then doing the rest of the logic which involves multiple subrequests.

This works fine in dev. However, in prod, it always does this first subrequest and then gets canceled:

POST https://z.advaith.workers.dev/ - Canceled @ 11/25/2025, 9:05:58 PM
  (log) deferring response...


console.log('deferring response...')

const deferResponse = await fetch(RouteBases.api + Routes.interactionCallback(interaction.id, interaction.token), {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
        type: InteractionResponseType.DeferredChannelMessageWithSource
    } satisfies APIInteractionResponse)
})

console.log('deferred')


What causes Workers to say "Canceled", and how can I fix this?
Was this page helpful?