๐ BUG: Doing fetch requests in a Worker...
Hi,
I have updated my workers and they are using 2.8.1 and now, when I do a env.SERVICE.fetch(request.clone()) it stalls with a " TypeError: Cannot construct a Request with a Request object that has already been used."
And it was working before, both in local and deployed in CF.
Could it be related to this issue https://github.com/cloudflare/wrangler2/issues/2589 ?
GitHub
๐ BUG: Doing fetch requests in a Worker that is invoked from Servic...
Which Cloudflare product(s) does this pertain to? Pages What version of Wrangler are you using? 2.8.0 What operating system are you using? MacOS Describe the Bug Bound Worker This Worker is called ...
4 Replies
I'm using a "api-gateway"-like code:
And following what's explained here https://developers.cloudflare.com/workers/platform/bindings/about-service-bindings/#gateway-worker-and-service-bindings-usage
About Service bindings ยท Cloudflare Workers docs
Service bindings are an API that facilitate Worker-to-Worker communication via explicit bindings defined in your configuration.
The Cloudflare Blog
Service Bindings are generally available, with efficient pricing
Service bindings are an API that facilitate Worker-to-Worker communication. You can invoke other Workers directly from your code; making it possible to communicate with shared services. Weโll also make it cost-efficient to run multiple Workers
Oh, I will need to wait till there is a new version given https://github.com/cloudflare/wrangler2/pull/2597 was added after the 2.8.1 release cut.
GitHub
fix: do not crash in wrangler dev when passing a request object to ...
What this PR solves / how to test:
This reverts and fixes the changes in #1769 which does not support creating requests from requests whose bodies have already been consumed.
Fixes #2562
To test y...