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
[Q] Is it possible to get a stack trace with both line numbers and column numbers? #238
With quickjs-emscripten, the stack trace only shows line numbers:
at f (example.js:3)
at <eval> (example.js:6)
Desired behavior
In developer tool's console, it shows column numbers, too:
Uncaught Error
at f (<anonymous>:2:7)
at <anonymous>:5:1
How to reproduce
Here's repro.ts:
import{errors,getQuickJS}from"npm:quickjs-emscripten";constQuickJS=awaitgetQuickJS();constvm=QuickJS.newContext();constcode=`const f = () => {throw new Error();};f();`;constevalResult=vm.evalCode(code,'example.js');try{constresult=vm.unwrapResult(evalResult);thrownewError('unreachable!');}catch(e: unknown){if(einstanceoferrors.QuickJSUnwrapError&&e.cause&&typeofe.cause==='object'&&'stack'ine.cause){console.log(e.cause.stack);}}
The result is as follows. It only contains line numbers:
$ deno run repro.ts
at f (example.js:3)
at <eval> (example.js:6)
I think in quickjs 2025-04-26, they started adding column numbers. Try updating to the latest quickjs-emscripten release which should include these changes. Although you may need to use a debug build or enable some debug features. Check quickjs.c for details.
Activity
Squashed 'vendor/quickjs/' changes from 36911f0..f113949
Squashed 'vendor/quickjs/' changes from 36911f0..f113949
Update vendored QuickJS to 2025-09-13 (rebased) (#243)
justjake commentedon Feb 16, 2026
I think in quickjs 2025-04-26, they started adding column numbers. Try updating to the latest quickjs-emscripten release which should include these changes. Although you may need to use a debug build or enable some debug features. Check quickjs.c for details.
toyboot4e commentedon Feb 16, 2026
Thank you. Now it shows column numbers, too:
Great!!
Update vendored QuickJS to 2025-09-13 (rebased) (justjake#243)