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.

Turn deprecation warnings into logs

See original GitHub issue

Deprecation warnings in the latest 3.x versions make my app look like it’s broken, while it works perfectly. I know that these warnings only appear in development, however they bring a lot of noise and potentially hide real errors.

Is it possible to turn these warnings into console.log() messages instead of console.error()?

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

Use code from 3.0 with the latest 3.x without error (because of semver)

Current Behavior 😯

Using an old Typography variant (like <Typography variant="title" />), or a <TableCell numeric />, or a raised Button raises error in the console:

image

Context 🔦

I’m migrating react-admin from material-ui v1 to material-ui v3 (cf https://github.com/marmelab/react-admin/pull/3102). And I can’t find a syntax that works for both versions 😦

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:31 (29 by maintainers)

github_iconTop GitHub Comments

2reactions
oliviertassinaricommented, Apr 18, 2019

It was designed on purpose to have the component stack trace, hence it’s verbose. It makes it much simpler to find the line of code responsible for the problem. It should only warn once.

1reaction
mediafreakchcommented, Sep 8, 2021

I am very confused about those console errors and it’s not clear to me how to get rid of them. They are very noisy, I can’t easily see the console errors I actually need to care about. I can’t influence the deprecation warnings myself, because they’re caused by a 3rd-party library (react-admin).

Maybe consider hiding them behind a config flag next time, or do it like Vue and provide a specific migration build/package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mui/material-ui - Turn deprecation warnings into logs - GitHub
Deprecation warnings in the latest 3.x versions make my app look like it's broken, while it works perfectly. I know that these warnings...
Read more >
The Complete Guide for Deprecation Warnings in Rails
When it comes to production, the easiest way to discover deprecation warnings is by using a monitoring tool (like Honeybadger or Airbrake). This ......
Read more >
warnings — Warning control — Python 3.11.1 documentation
The warnings filter controls whether warnings are ignored, displayed, or turned into errors (raising an exception). Conceptually, the warnings filter maintains ...
Read more >
How configure Rspec deprecation_stream so it logs ...
When I run a spec that has warnings without the code above, stdout displays a bunch of instances of: DEPRECATION WARNING: uniq is...
Read more >
Deprecated warnings in the logs with PHP 8.1 and 1.3
After I upgraded to PHP 8.1 and Flarum 1.3 I see some deprecation warnings in the php_errorlog. I thought I disabled them in...
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