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

Suppress unwanted warnings #1947

Closed
timse opened this issue Apr 7, 2017 · 20 comments
Closed

Suppress unwanted warnings #1947

timse opened this issue Apr 7, 2017 · 20 comments
Milestone

Comments

@timse
Copy link

timse commented Apr 7, 2017

As of webpack/webpack#4381 webpack will (once released) allow to suppress warnings as requested here: webpack/webpack#4263 .

Happy to help out with a PR, if you can specify what is wanted, wanted to be suppressed

@timse
Copy link
Author

timse commented Apr 7, 2017

followup from #1924 @Timer

@Timer Timer added this to the 1.0.0 milestone Apr 8, 2017
@Timer
Copy link
Contributor

Timer commented Apr 8, 2017

Perfect, we'll try to take a look at this soon, probably after the 0.10 release which should be by the end of the month.
We'll have to work out the details and wait on the webpack release anyway. 😄

@kellyrmilligan
Copy link
Contributor

man I need this! localForage gives the prebuilt file warning, so in CI it breaks. :(

@kellyrmilligan
Copy link
Contributor

is there any workaround to this ATM?

@FredrikNoren
Copy link

@kellyrmilligan This hack: CI=false yarn build (not sure what other implications setting CI to false has though)

@levrik
Copy link
Contributor

levrik commented May 25, 2017

@FredrikNoren This doesn't work for me... Do you have an idea why?

@gaearon
Copy link
Contributor

gaearon commented May 25, 2017

@levrik

What warnings exactly are you trying to suppress? The ones in this issue don’t seem to fire with latest versions.

@levrik
Copy link
Contributor

levrik commented May 25, 2017

@gaearon I want to suppress some linting warnings that are preventing the production deployment or... I don't really want to suppress them. I only want that they don't block the deployment.

@levrik
Copy link
Contributor

levrik commented May 25, 2017

@FredrikNoren @gaearon Ok

unset CI
yarn build
CI=true

did the trick. Seems like it's only checking for the existence of the CI variable and not for the content.

@mileung
Copy link

mileung commented Jun 9, 2017

Would be nice to suppress warnings like "warning 'variable' is assigned a value but never used no-unused-vars". I usually just duplicate a template folder to create a new component and they import things that haven't been used yet, so I get this warning a lot.

@midastouchprd
Copy link

@mileung

/* eslint-disable no-unused-vars*/

at the top of your files

should give you what you want

@gaearon
Copy link
Contributor

gaearon commented Jul 3, 2017

@mileung This warning is valuable for catching some very annoying mistakes though.

@mileung
Copy link

mileung commented Jul 3, 2017

@gaearon Probably, but I don't think importing something or making a new variable would cause anything to break; at least not in my current project.

@gaearon
Copy link
Contributor

gaearon commented Jul 3, 2017

It’s sometimes a sign of a mistake in logic. For example if you read some parameter but forget to use it. So it might not “break” things but might indicate that the code doesn’t do what you think it does. As for imports, it is valuable for catching unused imports that bloat the bundle. For example if you import a whole library in the main bundle but it’s only necessary in code split chunks.

@JReinhold
Copy link

I support this issue, it is especially relevant when getting warnings caused by other dependencies way down the dependency-tree. We can't find a way to get around this warning:

./~/ajv/lib/async.js
96:20-33 Critical dependency: the request of a dependency is an expression

./~/ajv/lib/async.js
119:15-28 Critical dependency: the request of a dependency is an expression

./~/ajv/lib/compile/index.js
13:21-34 Critical dependency: the request of a dependency is an expression

(the specific warning type is discussed in other issues, this was just to give an example that would support the issue of suppressing warnings).

So #1947 (comment) was a life safer for us.

@missbruni
Copy link

I know webpack has added a warning filter to their config but this does not solve our problem when getting warnings from other dependencies and not having access to configuration. Any solutions ?

@TSMMark
Copy link

TSMMark commented Nov 17, 2017

React's deprecation warnings after an upgrade cause Capybara PhantomJS to fail builds on CI. My temporary workaround was settings js_errors: false. Terrible bandaid, but now warnings aren't blocking deploys.

Now obviously the next step is to set js_errors: true and hunt down and fix every single warning. Fun

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

@isbdnt This doesn't solve anything for CRA users and is not relevant to this repository.

@TSMMark This issue is about build-time warnings and has nothing to do with React (runtime) warnings.

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

Going to close this as stale. Please raise a new issue with more details if you're interested in this.

@gaearon gaearon closed this as completed Jan 8, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

12 participants