cloudflare / cloudflare/workers-rs

[BUG] console_log! in bound service crash service when called from parent service

Open
#238 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.7k
Forks
429
Avg merge
20h 28m
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### What version of `workers-rs` are you using?

0.0.11

### Describe the bug

As the title says. There are two services: Parent (is a regular TS worker) and the Child is a Rust WASM worker. The parent TS/JS calls the child worker through env.child.fetch after doing a service binding to the child worker.

This doesn't work when used with the `log_request` request function in the template repository. If you uncomment the line that calls the function, the service will function. Otherwise, you'll get the following error:

```
{
"name": "Error",
"message": "The script will never generate a response.",
"timestamp": 1666681187481
}
```

### Steps To Reproduce

I made a repo that reproduces this error: https://github.com/omarabid/rust-bound-worker

Calling the child service is always successful. Calling the parent process will fail with the error mentioned above is `log_request` is called. Removing `log_request` does fix the problem.

Line in question: https://github.com/omarabid/rust-bound-worker/blob/95e13db5b59f740605b2839fb49ba9390c80e3e8/child/src/lib.rs#L18

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.