question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider not writing to stderr or allowing opt-out

See original GitHub issue

It’s a bit surprising to have a library write to stderr as a side effect of invoking it:

Browserslist: caniuse-lite is outdated. Please run next command yarn upgrade caniuse-lite browserslist

Perhaps browserlist could also accept a callback that it would yield warning messages to.

I definitely understand the reasoning behind these warnings, but tools using browserslist may have their own command line interfaces that would be disrupted by it writing to stderr. In this case it would be best to have the tool decide how to surface this feedback.

If it’s still absolutely necessary to write to stderr, perhaps a default implementation would do so, but if the library was invoked with an onWarn or similar, it would not.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
aicommented, Apr 2, 2019

Released in 4.5.4

1reaction
wbinnssmithcommented, Apr 2, 2019

Thanks for the reply @ai. Our use case is pretty close to what I described: in @parcel-bundler we invoke @babel/preset-env which uses browserslist. We have a rich cli interface[1] implemented with @vadimdemedes/ink, which relies on control of stdio. We currently patch console.log to avoid browserlist from writing directly to stderr.

[1] https://github.com/parcel-bundler/parcel/blob/v2-work-so-far/packages/reporters/cli/src/CLIReporter.js#L13

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Mojo::Server::Daemon debugging print to STDERR?
Setting the MOJO_DAEMON_DEBUG environment variable causes debugging messages to be printed to STDERR. Why does it use STDERR and not STDOUT?
Read more >
How do I write standard error to a file while using "tee" with a ...
The prompt is on a blank line letting me think the process is not finished, and when I press Enter this fix it....
Read more >
Separate stderr and stdout – IDEs Support (IntelliJ Platform)
I use the logging module for logging error messages and some of my scripts dump their output to stdout. In PyCharm, these get...
Read more >
What are stdin, stderr and stdout in Bash - Linux Hint
Essentially, they allow piping/redirecting data from one command to another. Let's check out how stdin, stderr, and stdout works and how you can...
Read more >
Revert/Modify "Create Pull Request" message on remote push ...
This is problematic for us because that message is shown in stderr and our build ... Why not write your script to work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found