[Bug]: page.evaluate in Chromium never settles when its argument nests 60 objects deep

Aperta
#44,060 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Una pull request collegata è già stata integrata.

  • #44069 di @microsoft-playwright-automation — integrata
  • #44070 di @yury-s — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
node.js, typescript

Direzione di ricerca

Start by reading the page.evaluate argument serialization path and the protocol handling for Chromium's Runtime.callFunctionOn response; the issue provides a reproducer in repro.mjs from the linked repository. Run it with arguments 59 and 60 objects deep and inspect the protocol trace. Done means the 60-deep call resolves or rejects with a useful depth error instead of hanging; two linked pull requests are already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

agent-triage
Version

main (d3ca7ab), with the Chromium it pins, 158.0.8127.18

Steps to reproduce
  1. Clone https://github.com/YevheniiKotyrlo/playwright-chromium-evaluate-deep-argument
  2. Run node repro.mjs with Node 18 or later and git. It clones main, runs npm ci and npm run build, installs the Chromium main pins, writes DEBUG=pw:protocol to a file, and in a new page calls
let argument = 0;
for (let level = 0; level < objects; level += 1) {
  argument = { children: [argument] };
}
await page.evaluate((value) => JSON.stringify(value).length, argument);

with objects at 59, then at 60, each raced against 10 seconds.

Expected behavior

The call with the argument 60 objects deep settles as the one 59 deep does: it resolves with the length, or rejects with an error that names the depth.

Actual behavior

It neither resolves nor rejects, so the caller waits until its own timeout. Chromium answers its Runtime.callFunctionOn with a parse error that carries no id:

microsoft/playwright d3ca7ab, Chromium 158.0.8127.18, Node v26.12.1, win32 x64
page.evaluate with an argument 59 objects deep: resolved with 886 after 14 ms
page.evaluate with an argument 60 objects deep: neither resolved nor rejected within 10 s after 10009 ms
Chromium's answer with no id: {"error":{"code":-32700,"message":"JSON: stack limit exceeded at position 2223"}}
summary: microsoft/playwright d3ca7ab with Chromium 158.0.8127.18 resolves page.evaluate with an argument 59 objects deep and neither resolves nor rejects it with one 60 deep
Environment
microsoft/playwright d3ca7ab, Chromium 158.0.8127.18, Node v26.12.1, win32 x64 (Windows 11 Pro)
Lingua principale
TypeScript
Stelle
99.7k
Fork
6.8k
Merge medio
16h 10m
PR unite (30g)
301

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/playwright

Tutte le issue di microsoft/playwright

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.