Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging a response consumes request body #18

Open
theduke opened this issue Oct 29, 2023 · 0 comments
Open

Logging a response consumes request body #18

theduke opened this issue Oct 29, 2023 · 0 comments
Labels
bug Something isn't working linear Created by Linear-GitHub Sync

Comments

@theduke
Copy link
Contributor

theduke commented Oct 29, 2023

addEventListener('fetch', (req) => {
  req.respondWith(handle(req));
});

async function handle(req) {
  let resp = await fetch("https://wasmer.io");
  console.log(resp);
  const body = await resp.text();
  return new Response('hello');
}

Error:

2023-10-29T13:26:29.872440Z ERROR wasmer_winter::server: could not process request error="Error {\n    context: \"javascript failed\",\n    source: \"Script execution failed: Response body has already been used.\",\n}"
@theduke theduke added the bug Something isn't working label Oct 29, 2023
@Arshia001 Arshia001 added the linear Created by Linear-GitHub Sync label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linear Created by Linear-GitHub Sync
Projects
None yet
Development

No branches or pull requests

2 participants