The `Maximum call stack size exceeded` error will be thrown in a web worker.
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## Bevy version
`main` branch
## \[Optional\] Relevant system information
macOS 14.4.1, M1 Max, Chrome 124 / Safari Technology Preview
## What you did
I used OffscreenCanvas to create a window plugin that allows [Bevy to run in a worker](https://github.com/jinleili/bevy-in-web-worker/blob/main/src/canvas_view/canvas_view_plugin.rs#L14).
## What went wrong
When running in debug mode within a web worker, if the time interval between frames in the first few frames is less than 1000ms, an 'Maximum call stack size exceeded' error will be thrown:
## Additional information
Repo: https://github.com/jinleili/bevy-in-web-worker
Can run normally if the time interval in the first few frames is 1000ms: https://jinleili.github.io/bevy_in_web_worker/index.html
Contributor guide
Research direction
Start by reproducing the debug-mode failure in the linked bevy-in-web-worker example, especially src/canvas_view/canvas_view_plugin.rs around line 14, using the OffscreenCanvas worker setup. Compare runs with and without a 1000ms delay between the first frames; done means the worker no longer throws “Maximum call stack size exceeded” under the reported conditions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100