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
/tmp/test.js:4
throw error;
^
Error: test
at Object.<anonymous> (/tmp/test.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
What is the expected behavior?
It should highlight the second line instead of fourth. Like this (but see Additional information):
/tmp/test.js:2
throw new Error('test');
^
Error: test
at Object.<anonymous> (/tmp/test.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
Additional information
Fourth line is hightlighted, but not included in the stacktrace, see #36485. Taking also that issue in the account the expected output would be something along those lines:
/tmp/test.js:2
throw new Error('test');
^
Error: test
at ???? (/tmp/test.js:4:8)
at Object.<anonymous> (/tmp/test.js:2:8)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
But I'm not sure what should come in the place of ????.
The text was updated successfully, but these errors were encountered:
The highlighted line is the one which threw the error. This behaviour is produced by V8 (the JS engine Node.js is using), you can reproduce the same behaviour on Chrome browsers as well:
VM65:4 Uncaught Error: test
at <anonymous>:2:8
If you don't like this behaviour, you can open an issue on the V8 issue tracker.
What steps will reproduce the bug?
Run the following code with
node
:What do you see instead?
This is the output on stderr:
What is the expected behavior?
It should highlight the second line instead of fourth. Like this (but see Additional information):
Additional information
Fourth line is hightlighted, but not included in the stacktrace, see #36485. Taking also that issue in the account the expected output would be something along those lines:
But I'm not sure what should come in the place of
????
.The text was updated successfully, but these errors were encountered: