You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Debugger: source-mapped stack traces and a Chrome DevTools Protocol (--inspect) endpoint #33
Slice has no debugger. --trace exports Chrome-trace span timelines, which is useful for profiling but there is no way to set a breakpoint, step, inspect scope, or evaluate in a paused frame.
Why it matters
In the conversations I have had evaluating Slice for teams, "can I attach a debugger?" is the first question after "does my framework run?". Hono, itty-router and Express-style apps now run unmodified (v0.10.5), which means the next blocker to adoption is the inner loop: a stack trace pointing into a SLICEBC blob with no line mapping, and no breakpoints. Bun, Deno and Node all speak the Chrome DevTools Protocol (CDP), so editors already have the client side.
Proposal (incremental)
Source-mapped stack traces first. CAS already embeds sourcemaps; ensure every Error.stack emitted from Boa is rewritten to original file:line:col before reaching user code or the CLI. Add a test that a thrown error in tests/apps/01 reports src/pricing_engine.ts:NN.
slice run --inspect[-brk]=host:port exposing a CDP WebSocket endpoint (the WebSocket server code from net/websocket.rs can be reused).
Implement the minimum CDP domains editors need: Runtime.enable/evaluate/getProperties, Debugger.enable/setBreakpointByUrl/pause/resume/stepOver/stepInto/stepOut/getScriptSource, Debugger.paused/resumed events with call frames and scope chains.
Boa side: a per-instruction hook in the VM dispatch loop that checks a breakpoint bitmap for the current CodeBlock/pc (the vendored engine in vendor/boa_engine makes this feasible; upstream Boa has an experimental --debugger flag worth tracking). The same hook can share the fuel counter so debugging does not disturb metering.
Fuel/timeout should be suspended while paused, and resumed on Debugger.resume.
Even step 1 alone would be a significant DX improvement.
Kept the fused runtime prelude on a single line so SLICEBC\x01 pre-compiled bytecode line numbers align 1:1 with //@sm: source map markers.
Extended source map resolution to cover ES6 class methods, dynamic error prefixes (TypeError, ReferenceError, etc.), and uncaught exception output so original : locations are preserved.
Activity
siktec-lab commentedon Nov 9, 2026
Addressed in #41 (�0.10.6).