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

[utils] Please make component "warnings" actually warnings #347

Open
tonywu6 opened this issue Sep 20, 2022 · 2 comments
Open

[utils] Please make component "warnings" actually warnings #347

tonywu6 opened this issue Sep 20, 2022 · 2 comments

Comments

@tonywu6
Copy link

tonywu6 commented Sep 20, 2022

Component warnings are currently printed as errors:

util/src/warning.ts

Lines 4 to 9 in db8b843

export function warning(valid: boolean, message: string) {
// Support uglify
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
console.error(`Warning: ${message}`);
}
}

In development, they show up in the console like this:

Screen Shot 2022-09-20 at 10 26 35 AM

The stack traces are unnecessary. They flood our consoles and make deprecation messages themselves hard to spot.

And deprecation warnings are not errors, and they should not be displayed as such. Showing them as errors distracts developers from actually critical errors, causes unnecessary panics, makes Ant Design unpleasant to work with, and developers are more likely to ignore future deprecation notices (a cry-wolf effect).

Please use console.warn for your deprecation warnings.

Screen Shot 2022-09-20 at 10 38 32 AM

@mellis481
Copy link

@zombieJ @afc163 Can this please be addressed? This is inexcusable and causes lots of problems.

@afc163
Copy link
Member

afc163 commented Jun 28, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants