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.

Option to silence/disable warnings [Feature request]

See original GitHub issue

Hi, would you consider adding an option to run in silent mode, meaning that warnings are not shown? I’m getting a lot of warnings about not finding proptypes from react-router-dom, but those are all flow types being used as flow types and not proptypes, so I don’t really care about the warnings. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
brigandcommented, Feb 19, 2018

@IanVS the issue is that we’re not giving the warning. For your code sample, we generate this code:

import React, { PureComponent } from "react";

export class MyComponent extends PureComponent {
  render() {
    return React.createElement("div", null);
  }
}
MyComponent.propTypes =
  bpfrpt_proptype_ContextRouter === PropTypes.any
    ? {}
    : bpfrpt_proptype_ContextRouter;
import { bpfrpt_proptype_ContextRouter } from "react-router-dom";
import PropTypes from "prop-types";

Since the file react-router-dom resolves to is an ES6 module, and doesn’t have an export with that name, webpack issues a warning.

The obvious solution is to check the specified import like, /^\w/.test('react-router-dom'), however that breaks code adding a ‘module directory’ or alias, e.g. import X from 'src/foo/bar', so it’s not a perfect solution. I think this is good enough though.

0reactions
brigandcommented, Mar 16, 2018

Yeah, should be fixed. Please open another issue if there are further issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable Python warnings? - Stack Overflow
Look at the Temporarily Suppressing Warnings section of the Python docs: If you are using code that you know will raise a warning,...
Read more >
Using the GNU Compiler Collection (GCC): Warning Options
3.8 Options to Request or Suppress Warnings. Warnings are diagnostic messages that report constructions that are not inherently erroneous but that are risky...
Read more >
Options to Request or Suppress Warnings — gcc 6 ... - Fedora
You can request many specific warnings with options beginning with -W, for example -Wimplicit to request warnings on implicit declarations.
Read more >
Warning Options - Using and Porting GNU Fortran
5.5 Options to Request or Suppress Warnings. Warnings are diagnostic messages that report constructions which are not inherently erroneous but which are ...
Read more >
Perl pragma to control optional warnings - Perldoc Browser
It's a more flexible alternative for both the command line flag -w and the equivalent ... For a start, say you want to...
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