fix(cli): page closures survive keepNames transpilation; format motion-blur

Running the CLI from source (tsx dev script, as CI's smoke job does)
transpiles with keepNames, which rewrites named inner functions in
serialized page closures into __name(...) calls — a helper that exists
in the Node bundle but not in the browser realm. The unified seek
closure was the first validate-path page function with named inner
functions, so 'hyperframes validate' threw '__name is not defined' in
CI while the dist build worked. Every session opener now installs a
no-op __name shim via evaluateOnNewDocument before any page script
runs, immunizing all serialized closures regardless of build mode.
This commit is contained in:
Miguel Angel Simon Sierra
2026-07-10 14:30:54 -04:00
parent 4b03866c02
commit 2ceb0683a8
5 changed files with 48 additions and 4 deletions
+2
View File
@@ -15,6 +15,7 @@ import { resolveCompositionViewportFromHtml } from "../utils/compositionViewport
import { c } from "../ui/colors.js";
import { printDeprecationNotice, withMeta } from "../utils/updateCheck.js";
import {
installPageFunctionGuard,
resolveCliChromeGpuMode,
seekCompositionTimeline,
} from "../capture/captureCompositionFrame.js";
@@ -421,6 +422,7 @@ async function validateInBrowser(
});
const page = await chromeBrowser.newPage();
await installPageFunctionGuard(page);
await page.setViewport(viewport);
page.on("console", (msg) => {