Skip to content

eval command sometimes produces no output on failure #487

Description

@galaxyeye

Severity: Medium
Category: Bug / Reliability

Summary

When browser4-cli eval is used to run a JavaScript expression that fails, returns an object that cannot be serialized, or encounters an error, it sometimes produces no output at all — neither a result, nor an error message, nor a status indicator.

Steps to Reproduce

  1. Run browser4-cli eval with a complex expression that returns an object (e.g., document.querySelectorAll('...')).
  2. Observe that no output is produced.

Expected Behavior

The command should always produce output — at minimum:

  • The serialized result (even if null or undefined).
  • A clear error message if the expression throws.
  • An indicator if the result cannot be serialized (e.g., a DOM element reference).

Actual Behavior

Sometimes the command produces no output at all. This silent failure leaves the user unable to determine whether the expression ran, failed, or simply returned an empty/undefined result.

Suggested Fix

Ensure eval always outputs something. At minimum, convert null and undefined to their string representations. For DOM elements and non-serializable objects, output a descriptive type indicator rather than nothing. If an error occurs, surface it explicitly.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions