-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Make warnings more beginner-friendly #11703
Comments
It's also surprising that the warnings are prefixed with |
Related discussion: #9516 |
About the format for deprecations: I think adding a URL to anchors in https://github.com/nodejs/node/blob/master/doc/api/deprecations.md (or on the website once they get rendered) could be more helpful(if stderr is TTY, maybe). The explanation of the format can be added to that document too (along with how to |
wrt. the idea of adding anchor URLs to node's deprecations page, note that the deprecation API is deliberately exported for use by thirdparty modules, so changes to make it work better for node users can't be too node-specific. |
@sam-github Which I think is a reason not to export the deprecation API. Otherwise providing a URL in the deprecation message is a great idea. Listing all the deprecation-related flags would take up too much space. |
👍
Seems reasonable. I'm just asking for a hint on how to proceed. |
@jhnns the way to proceed is to PR an improvement to util.deprecate that includes useful information. People will have lots of comments, that's a good thing. It may be that the changes are too large, and aren't backwards compatible. That's OK, if there is agreement that the messaging is much improved, then you'll just have to fork the util.deprecate API, make one in See: #12631 (comment) Sorry for all the cross-linking, but the conversation spawns three threads ATM. |
One possibility here is to add a new option to |
Also note that the |
Should this remain open? (I can't tell.) |
Another two months passed with no activity. I'll close this out. |
This issue came up while discussing #11642
The problem with the warnings emitted by
process.emitWarning
is that they provide little information about the context or how to get more information. Unless the user knows about the cli flags like--trace-warnings
or the warning API, there is no clue on how to proceed. A simple solution would be to append a short explanation like Use the --trace-warnings command line flag to get a full stack trace of this warning. if the flag is not set.The text was updated successfully, but these errors were encountered: