Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

respondWith should no-op/throw when called outside context of fetch event #107

Open
jdanyow opened this issue Jul 8, 2019 · 1 comment

Comments

@jdanyow
Copy link
Contributor

jdanyow commented Jul 8, 2019

addEventListener('fetch', async event => {
  await Promise.resolve();
  // In production, this is a no-op because respondWith was not called immediately.
  // cloudworker is returning the response. Perhaps it should throw to help folks catch issues quickly.
  event.respondWith(new Response('hello world'));
});
@hankjacobs
Copy link
Contributor

thanks! I'll take a look at this sometime soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants