Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: display Deno version at the end of stacktraces on fatal exception that causes exit #12498

Closed
theoludwig opened this issue Oct 19, 2021 · 3 comments
Labels
suggestion suggestions for new features (yet to be agreed)

Comments

@theoludwig
Copy link

theoludwig commented Oct 19, 2021

Hey! 👋

Node.js v17.0.0 has been released, it includes this PR: nodejs/node#38332
It prints the Node.js version used on fatal exceptions that causes exit (that are not encapsulated by try/catch).

It could be a feature, that Deno could also do, it is easier for debugging so you don't have to ask "what version are you on?", it is directly in the error the user copy/paste from when asking for help.

Currently:
With a file app.ts :

throw new Error('Error...')

When we do deno run app.ts, it prints:

error: Uncaught Error: Error...
throw new Error('Error...')
      ^
    at file:///home/divlo/Documents/testing/test-ts/app.ts:1:7

What about something like this?

error: Uncaught Error: Error...
throw new Error('Error...')
      ^
    at file:///home/divlo/Documents/testing/test-ts/app.ts:1:7

Deno v1.15.2
@kitsonk kitsonk added the suggestion suggestions for new features (yet to be agreed) label Oct 21, 2021
@dsherret
Copy link
Member

dsherret commented Dec 1, 2021

I don't think it's worth it to add and maintain this feature as bug reporting without the version hasn't been that much of an issue (at least from what I've seen... it does happen, but usually we just ask people what version it is in those cases where it's necessary). Also, some people don't even include the error message or stack trace so in some scenarios this wouldn't help. Having the version there also creates extra noise and takes up more vertical space on errors. Additionally, in most cases errors thrown like this aren't Deno bugs, but rather bugs in the code.

If people not including the version number in bug reports is an issue, I would recommend we improve the bug report template to ask people to run deno -V and paste in their version number. It's not too difficult to run this command and quite common practice.

@jaydenseric
Copy link

I'm not a fan of it, because it makes snapshot testing stderr that much harder when running tests in CI against multiple runtime versions. You have to use regex or something to normalise the output.

The Node.js v17.0.0 major change has actually broken some of my tests, e.g:

https://github.com/jaydenseric/coverage-node/runs/4947577926?check_suite_focus=true#step:4:76

@bartlomieju
Copy link
Member

@jaydenseric good point. As stated by @dsherret we were not really keen on doing it anyway. I'm going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

5 participants