dotnet/runtime · error · Error
Failed on mono_wasm_get_dbg_command_info
Error message
Failed on mono_wasm_get_dbg_command_info
What it means
Thrown by mono_wasm_get_dbg_command_info() in debug.ts. Unlike the send functions, this reads the command id 0 entry from the commands_received map (the special handshake/info slot populated by native). A res_ok=false here means the native debugger agent failed to produce the initial command info, i.e. the debugger protocol handshake or the very first info query failed.
Source
Thrown at src/mono/browser/runtime/debug.ts:109
export function mono_wasm_send_dbg_command (id: number, command_set: number, command: number, command_parameters: string): CommandResponseResult {
forceThreadMemoryViewRefresh();
mono_wasm_malloc_and_set_debug_buffer(command_parameters);
cwraps.mono_wasm_send_dbg_command(id, command_set, command, _debugger_buffer, command_parameters.length);
const { res_ok, res } = commands_received.remove(id);
if (!res_ok)
throw new Error("Failed on mono_wasm_send_dbg_command");
return res;
}
export function mono_wasm_get_dbg_command_info (): CommandResponseResult {
const { res_ok, res } = commands_received.remove(0);
if (!res_ok)
throw new Error("Failed on mono_wasm_get_dbg_command_info");
return res;
}
export function mono_wasm_debugger_resume (): void {
forceThreadMemoryViewRefresh();
}
export function mono_wasm_detach_debugger (): void {
forceThreadMemoryViewRefresh();
cwraps.mono_wasm_set_is_debugger_attached(false);
}
export function mono_wasm_change_debugger_log_level (level: number): void {
forceThreadMemoryViewRefresh();
cwraps.mono_wasm_change_debugger_log_level(level);
}
/**View on GitHub (pinned to 290d5ab72c)
Solutions
- Wait until the runtime/debugger agent signals ready before issuing info queries (mono_wasm_runtime_ready / waitForDebugger flow).
- Build the app with debugger support enabled (debug configuration, not a release build that strips the debugger).
- Reload so the native agent re-initializes cleanly.
- Confirm DOTNET_SYSTEM_NET_* and debugger-related build properties are not disabling the diagnostic/debug agent.
Example fix
null
Defensive patterns
Strategy: try-catch
Validate before calling
null
Type guard
null
Try / catch
let info;
try { info = mono_wasm_get_dbg_command_info(); }
catch (e) { /* debugger agent not ready/errored; wait and retry or report */ throw e; } Prevention
- Build with debugger support enabled.
- Wait for runtime ready before issuing debugger info queries.
- Reload to reinitialize a wedged native agent.
When it happens
Trigger: Calling mono_wasm_get_dbg_command_info() before the native debugger agent has pushed the id=0 response, or when the native agent errored during its initial command. Racing the info query with runtime teardown or before the debugger module finished initializing.
Common situations: Attaching DevTools/VS Code debugger before the WASM runtime debugger agent is fully ready. Debugging a build where the debugger native code was stripped or a debugger-related env var disabled the agent. A runtime build that did not include debugger support.
Related errors
- Failed on mono_wasm_send_dbg_command_with_parms
- Failed on mono_wasm_send_dbg_command
- event must be an object, but got ${JSON.stringify(event)}
- event.eventName is a required parameter, in event: ${JSON.st
- args must be an object, but got ${JSON.stringify(args)}
AI-assisted analysis of dotnet/runtime@290d5ab72c (2026-08-06).
Data as JSON: /api/errors/2bc853c7d792e3e5.
Report an issue: GitHub.