Skip to content

eval/collected-promise-error

The error an evaluation raises when the promise it awaited was garbage-collected before it settled.

A promise nothing references can never be resolved, so Chromium is free to collect it, and CDP then answers Runtime.evaluate with the protocol error Promise was collected instead of a result. It is a type of its own so a caller can instanceof-match it, and so the report names the real cause rather than whatever later read the missing result.

Class Description
CollectedPromiseError Thrown when an evaluated closure awaited a promise that was garbage-collected, so it could never settle.
Interface Description
CollectedPromiseErrorConstructorParams Parameters for the CollectedPromiseError constructor.