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
If you wrap the code in try..catch you'll get the correct line number
bun run test.js
at /home/user/bin/test.js:5:11
1 | try {
2 | let obj
3 | let {id} = obj
4 | } catch (e) {
5 | console.log(e);
^
TypeError: Right side of assignment cannot be destructured
at /home/user/bin/test.js:5:3
deno -A test.js
TypeError: Cannot destructure property 'id' of 'obj' as it is undefined.
at file:///home/user/bin/test.js:3:8
node test.js
TypeError: Cannot destructure property 'id' of 'obj' as it is undefined.
at Object.<anonymous> (/home/user/bin/test.js:3:8)
at Module._compile (node:internal/modules/cjs/loader:1568:14)
at Object..js (node:internal/modules/cjs/loader:1711:10)
at Module.load (node:internal/modules/cjs/loader:1328:32)
at Function._load (node:internal/modules/cjs/loader:1138:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49
What version of Bun is running?
1.1.31+e448c4cc3
What platform is your computer?
No response
What steps can reproduce the bug?
run a simple script
err.js
:What is the expected behavior?
report error on line 2
What do you see instead?
error reported on line 1
Additional information
as expected issue is the same on linux and windows.
The text was updated successfully, but these errors were encountered: