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.

Stop showing warnings as errors.

See original GitHub issue

I can’t debug my own code because of the warnings spam. The warning spam is beyond my control because react router is having conflicts with history that they haven’t resolved. It’s very frustrating to experience this:

2015-12-09 at 3 36 pm

without having any recourse short of installing out of date deps. Show warnings as warnings. That’s what console.warning is for.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:26
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

22reactions
brigandcommented, Jul 25, 2016

@Elijen you’re expected to prevent the warnings by fixing your code. If they’re not actionable then that’s a problem with those specific warnings, not warnings in general.

21reactions
dswbxcommented, Feb 25, 2019

maybe this code snippet would help some of you. I’m using this myself:

const errorsToWarn: string[] = [
    "Warning:",
];
const oldConsError = console.error;
console.error = function(...args: any) {
    let toWarn: boolean = false;

    if (typeof args[0] === 'string') {
        errorsToWarn.map(function(_s: string) {
            if (args[0].startsWith(_s)) {
                toWarn = true;
            }
        })
    }

    toWarn ? console.warn(...args) : oldConsError(...args);
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Disable all warnings. | Apple Developer Forums
You can hide the warnings (not errors) in the Issue navigator on the left with the filter button at the bottom · Xcode...
Read more >
Suppress compiler warnings - Visual Studio - Microsoft Learn
In Solution Explorer, choose the project in which you want to suppress warnings. Right-click on the project node, and choose Properties on ...
Read more >
Can I hide errors and warnings that are displayed on my ...
PHP Errors and warnings can be turned off in several ways: From hPanel. From WordPress configuration file. From .htaccess. From the PHP file...
Read more >
How to disable inline warnings/errors? - Eclipse
For Java classes, suddenly compile warnings and errors are displayed ... How can I disable this, and only show warnings/errors in the left ......
Read more >
Disable "treat warnings as errors" in Rider for Unreal?
... of warnings. How can I keep it from stopping my compile? ... Hello,. A lot of compiler warnings are treated as errors...
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