X_E2E_EVALUATE_CAPTURED
Means
a page.evaluate() closure named a binding the page does not have
Typical cause
raised from the page's own ReferenceError, naming the binding, because no static scan can catch it: measured on Bun 1.4.0, const wanted = 3; (() => wanted === 3).toString() is "() => !0" — the transpiler constant-folds a captured primitive away before toString() runs, so a captured value may not exist in the source at all
Fix
pass the value through the page instead of closing over it