Skip to content

fix(interpreter): send console arguments to devtools as strings - #5871

Open
drakeo338 wants to merge 1 commit into
DioxusLabs:mainfrom
drakeo338:claude/5869-fix
Open

drakeo338 wants to merge 1 commit into
DioxusLabs:mainfrom
drakeo338:claude/5869-fix

Conversation

@drakeo338

Copy link
Copy Markdown

Fixes #5869.

The patched console methods sent their raw arguments as messages, but the devtools server expects Vec<String>. Any non-string argument, such as console.log("Wee", {a: 1}), failed to deserialize and the log line was dropped. Each argument is now converted to a string before sending: strings pass through, everything else goes through JSON.stringify, falling back to String() if that throws or returns undefined.

I added a spec in patch_console.spec.ts that fails without the change and passes with it, and regenerated patch_console.js and hash.txt. I did not run the Rust checks (cargo check, make check), so they are not ticked or claimed.

The patched console methods put the raw arguments into the Log message.
The server expects `messages: Vec<String>`, so any non-string argument,
such as `console.log("Wee", {a: 1})`, failed to deserialize and was
dropped.

Map each argument to a string before sending: strings are kept as-is,
everything else goes through JSON.stringify, falling back to String()
when that throws or returns undefined.

Fixes DioxusLabs#5869
@nicoburns
nicoburns enabled auto-merge (squash) September 30, 2026 13:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dev mode console logging "monkeyPatch" fails when logging objects.

1 participant