Skip to content

Desktop: Disable console wrapper #12663

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

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Jul 2, 2025

Summary

This pull request disables a wrapper around console.* methods. This wrapper made it more difficult to determine where error messages came from in the development tools.

Does not completely resolve #12451, since the full-page error modals still have incorrect stack traces.

Comment on lines -48 to -54
output.warn = function(...text) {
const s = [...text].join('');
// React spams the console with walls of warnings even outside of strict mode, and even after having renamed
// unsafe methods to UNSAFE_xxxx, so we need to hack the console to remove them...
if (s.indexOf('Warning: componentWillReceiveProps has been renamed, and is not recommended for use') === 0) return;
if (s.indexOf('Warning: componentWillUpdate has been renamed, and is not recommended for use.') === 0) return;
oldConsole.warn(...text);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on a code search, all usages of componentWillReceiveProps and componentWillUpdate in Joplin's components seem to have been renamed. It's possible that one of Joplin's dependencies still uses them, but I haven't noticed related log output.

@laurent22 laurent22 merged commit 5ec79c7 into laurent22:dev Jul 2, 2025
11 of 13 checks passed
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

Successfully merging this pull request may close these issues.

Desktop: Log output points to bundled file
2 participants