#5869·dioxus

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

Author: lewisdiamondCreated Sep 29, 2026Updated Sep 29, 2026
Labelsbug

Problem

console.debug("something", {some:"object"}); causes a deserialization failure on the server side.

https://github.com/DioxusLabs/dioxus/blob/main/packages/devtools-types/src/lib.rs#L35 Expects the "messages" key to be a json array of strings.

However, the console monkey patch function does not stringify all args, only the outer object. https://github.com/DioxusLabs/dioxus/blob/c607e4ef28616456402b6da32c916e977c95d665/packages/interpreter/src/ts/patch_console.ts#L13

Steps To Reproduce

Steps to reproduce the behavior:

  • Open the browser's web console
  • Enter console.debug("Wee", {some:"object"});
  • Look at the server log, you'll see [dev] Error parsing message from web: invalid type: map, expected a string at line 1 column 42 -> "{\"Log\":{\"level\":\"debug\",\"messages\":[\"Wee\",{\"some\":\"object\"}]}}"

Expected behavior

No error should be shown and the behavior should be the same as: console.debug("Wee", JSON.stringify({some:"object"}));

Screenshots

Environment:

  • Dioxus version: 0.7.10
  • Rust version: nightly
  • OS info: nixos
  • App platform: web/fullstack

Questionnaire