Motion 15.0.1: throw inside frame.read() permanently kills the entire frameloop
Comments · 0
Be the first to comment.
Bug reportby SceneRecap AI
Repro steps
- 1.Open the test page 'motion@15.0.1, frame.read() throw stops frameloop'. Confirm the badge reads 'Frameloop running' and the onUpdate() counter climbs about 60 per second.
- 2.Wait for the frameloop to run steadily. The counter reaches 767 and the square keeps rotating.
- 3.Click the button 'Throw in frame.read() callback'.
- 4.Watch the onUpdate() counter and the rotating square for several seconds.
Expected
An error thrown inside one frame.read() callback is reported. It does not stop the scheduler. Other scheduled work and animations keep running, and the onUpdate() counter keeps going up at about 60 per second.
Actual
After the throw, a console error 'frame.read() throw test' is logged. The frameloop then stops for good. The onUpdate() counter freezes at 889 and the square stops rotating. The badge reads 'Frameloop DEAD, all animations frozen'. There is no recovery: the counter is still 889 at 31.0s, about 16s after the throw.
Evidence
Issue markdown (copy-paste ready)
## Summary In motion@15.0.1, one error thrown inside a `frame.read()` callback permanently stops the whole frameloop. Every animation and `onUpdate()` subscriber freezes and never recovers. Related: motiondivision/motion#4134. ## Environment - Browser: Chromium 151.0.7922.34 - OS: macOS - Viewport: 1280x720, DPR 1 - Library: motion@15.0.1 (cdn.jsdelivr.net) ## Steps to reproduce 1. Open the test page. The badge reads **Frameloop running** and the `onUpdate()` counter climbs about 60/s (49 at 1.0s, 767 at 13.0s). 2. Click **Throw in frame.read() callback** (14.859s). 3. Watch the counter and the rotating square. ## Expected The error from the failing `frame.read()` callback is reported. The frameloop keeps ticking, so other animations and `onUpdate()` callbacks keep running. ## Actual - Console error at 15.084s: `frame.read() throw test`. - By 17.0s the badge reads **Frameloop DEAD, all animations frozen**. - The log shows `counter before throw : 889` and `counter after +700ms: 889`. - The counter is still 889 at 31.0s. The square stays frozen. The loop never recovers. - Minor: the FPS label still shows `~60 fps` while the loop is dead. ## Evidence | t (s) | Kind | Detail | |---|---|---| | 13.0 | visual | Loop works before the throw: counter 767, badge 'Frameloop running' | | 14.9 | visual | Counter 875 at click time, still running | | 15.084 | console | `frame.read() throw test` | | 17.0 | visual | Badge 'Frameloop DEAD', counter frozen at 889 | | 31.0 | visual | Counter still 889, no recovery | ## Suggested area The frameloop scheduler's step processing. An exception in a read-phase callback appears to exit the loop before the next tick is scheduled. Isolate each callback (try/catch, or reschedule in `finally`) so one bad callback cannot halt every animation. *Recorded with SceneRecap.*
This report was written by SceneRecap from a screen recording. Try SceneRecap free
Turn a screen recording into a bug report like this one.
Repro steps, expected vs actual and the console and network evidence, each with a timestamp. On every plan, Free included.
Try SceneRecap free →