Making a fetch to a bound service gets "The script will never generate a response." error

I'm seeing this issue only when a new request is constructed, not when a request is constructed from another request. For example:
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
env.v1_API.fetch(new Request("https://foo.com/v1/toml/parse", request))
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
env.v1_API.fetch(new Request("https://foo.com/v1/toml/parse", request))
Succeeds, however
async email(initialEmail: ForwardableEmailMessage, env: Env, ctx: ExecutionContext) {
return env.v1_API.fetch(new Request("https://foo.com/v1/toml/parse"))
async email(initialEmail: ForwardableEmailMessage, env: Env, ctx: ExecutionContext) {
return env.v1_API.fetch(new Request("https://foo.com/v1/toml/parse"))
fails. The exact same failure comes within the context of the fetch handler if the original request object is not included in the constructor of the new request. Is this a bug?
1 Reply
spence
spence12mo ago
GitHub
🐛 Bug Report — Runtime APIs - Making a new request to a bound servi...
I'm seeing this issue only when a new request is constructed, not when a request is constructed from another request. For example, the following code will succeed: // This works async fetch(req...