Debugging

Read errors, attach a debugger, measure coverage, profile, trace, and report bugs.

Read errors

elide --error-format=plain run app.js

Plain errors go to stderr with a short stack; program output stays on stdout. Add --verbose or --debug for Elide’s own logs.

Viewing an uncaught program error in Elide
FlagEffect
--abort-on-uncaught-exceptionPrint the error, then raise SIGABRT (exit 134) so the OS writes a core dump.
--redirect-warnings=FILEWrite process warnings, such as process.emitWarning(), to FILE, not stderr.
--timeout=DURATIONStop the program after DURATION (for example 30s) with exit 124.
--max-mem=SIZELimit the heap size, for example 512m. Exceeding it fails with a nonzero exit.
elide --profiler and --debugger — profiler report and debug endpoints

Attach a debugger

ProgramFlagListens onClient
JavaScript, TypeScript, Python--debugger=cdpws://127.0.0.1:1337/…Chrome DevTools or any CDP client
JavaScript, TypeScript, Python--debugger=dap127.0.0.1:4711, waits for a clientAny DAP-capable editor
Java, Kotlin--debugger127.0.0.1:5005 (JDWP), suspendedIntelliJ IDEA, VS Code, jdb
elide run --debugger=cdp app.js
Debugger listening on ws://127.0.0.1:1337/<id>/inspect
For help, see: https://docs.elide.dev/guides/debugging
E.g. in Chrome open: devtools://devtools/bundled/js_app.html?ws=127.0.0.1:1337/<id>/inspect

Open the devtools:// link in Chrome.

elide run --debugger=dap app.js
elide run --debugger Hello.kt
Listening for transport dt_socket at address: 5005

Change a listener’s address with --debugger-host and --debugger-port:

elide run --debugger=dap --debugger-port=5678 app.js
elide run --debugger=0.0.0.0:5005 Hello.kt

A number or host:port after --debugger is a JDWP address and applies to Java and Kotlin only. JDWP has no authentication: bind beyond loopback only on a trusted network, or use an SSH tunnel.

Debug tests

elide test --debugger
elide test --debugger=dap sample.test.mts
elide test --debugger=5005
FlagDebugs
--debuggerGuest tests over CDP and JVM tests over JDWP on 5005
--debugger=cdp or dapGuest tests only
--debugger=PORTJVM tests only

A path narrows guest tests to one file. Narrow JVM tests by package name, not by path. While a debugger is attached, guest test files run one at a time.

Measure coverage

elide run --coverage app.js

Elide prints a Coverage Report after the program exits, with statements, lines and functions covered per file.

Profile CPU time

elide run --profiler=cputracing app.js
╭Profiler Report───────────────────────────────────────────────────────────────╮
│ Location           Root               Total        Interpreted      Compiled │
│   app.js            fib       21.89k 100.0%      21.89k 100.0%        0 0.0% │
│   app.js       :program              1 0.0%           1 100.0%        0 0.0% │
╰──────────────────────────────────────────────────────────────────────────────╯

Total counts calls to each function. For JFR recordings, heap dumps and Linux perf, see Monitoring and Profiling.

Trace with Insights

// insight.js
insight.on("enter", (ctx) => {
  console.log("enter", ctx.name);
}, { roots: true });
elide run --insights=insight.js app.js

Each function entry prints a line such as enter fib. See the Insights API for events and filters.

Report a bug

elide info
elide agent diagnostics
elide agent bug

elide agent bug prints the issue tracker URL and a Markdown report template. Fill in the exact command, the expected behavior, and any crash report.