Conversation
The capture loop treated any page.screenshot() rejection as terminal: it stopped, captured nothing further, and the export then died with "No frames were captured". A transient Page.captureScreenshot protocol error is ordinary on a page under load -- a heavy animation or a font swap is enough -- so recording a real site could fail outright. Odder still, a failed frame *write* eleven lines up already did the right thing: drop the frame, keep the queue moving. The two paths now agree. A closed page still stops immediately, since there is nothing left to shoot, and ten consecutive failures still give up rather than spinning at the frame rate forever. The warning fires once per run of failures instead of once per frame. Found by pointing the new CLI at humanjs.dev, which reproduced it every time; the same page now records through the dropped frame.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recording a real site could fail outright and report only this:
Neither suggestion was the cause. The actual cause was one screenshot failing.
What was happening
packages/playwright/src/recording/capture.tstreated anypage.screenshot()rejection as terminal — setstopped = trueand return. So a single transient error meant zero frames from that point on, and if it happened early, zero frames at all. The export then failed with a message describing two things that had not gone wrong.A transient
Page.captureScreenshot: Unable to capture screenshotis ordinary on a page under load; a heavy animation or a font swap is enough to make Chromium miss one.The tell was eleven lines up, where a failed frame write already did the right thing:
Writes tolerated failure; screenshots did not. The two paths now agree.
Behaviour now
The failure counter resets on every success, so scattered misses across a long recording never accumulate into a false give-up.
Verification
5 unit tests driving the loop with scripted screenshot behaviour: transient recovery, warn-once, silent stop on a closed page, the consecutive cap actually bounding the call count, and the counter resetting on success.
The real check is the page that found it.
https://humanjs.devreproduced the failure every time and now records through it:Whole suite green:
lint,typecheck(10/10),test(9/9),build(7/7),check:exports(13/13).Found while dogfooding #118.