You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a JS error in WP admin with a site I manage, and I've traced it to the inclusion of WYSIWYG fields via CMB2.
Unfortunately I can't replicate it with a vanilla installation, so it's probably a clash with something in our custom theme. However I've spent a long time trying to track this down without success, so I wondered if anyone might have encountered something similar, or is aware of related issues that might give a clue about how to debug this.
The error is coming from /wp-includes/js/tinymce/themes/modern/theme.js line 2427:
elm.setAttribute(name === 'role' ? name : 'aria-' + name, value);
The error is 'Uncaught TypeError: Cannot read properties of undefined (reading 'setAttribute')'. The var elm here seems to have this opening tag (name = 'role' and value = 'button' - check source context for how vars are derived):
The error prevents the whole metabox that the TinyMCE field is in from being rendered, and halts JS execution on the page.
This is with WP 6.1.1 (using multisite to run the client's main site and a subsite together), and CMB2 2.10.1.
I appreciate since this can't be replicated there might not be much you can do, but the issue has started happening recently (the site is a few years old), and I've spent so much time on it I need to move onto other work now and I'm posting on the off-chance it rings a bell for someone.
The text was updated successfully, but these errors were encountered:
I assume it's perhaps only happening when you are editing a post that has a CMB2-powered WYSIWYG field? What if you temporarily remove that field type from the config, does the rest just work?
Yes, it only happens when the page you're editing has a metabox with a WYSIWYG CMB2 field.
Update: I've discovered that the issue doesn't happen on pages where we've disabled Gutenberg (e.g. the home page, where there are only custom fields, no main content space - Gutenberg is disabled selectively using the gutenberg_can_edit_post_type and use_block_editor_for_post_type filters). However, things worked on Gutenberg screens for the vanilla installation testing. But, we have a gutenberg.php functions file in our custom theme, and I tried copying everything in there across to the vanilla installation functions file, and everything still worked. I'll keep you posted if I find anything else.
There's a JS error in WP admin with a site I manage, and I've traced it to the inclusion of WYSIWYG fields via CMB2.
Unfortunately I can't replicate it with a vanilla installation, so it's probably a clash with something in our custom theme. However I've spent a long time trying to track this down without success, so I wondered if anyone might have encountered something similar, or is aware of related issues that might give a clue about how to debug this.
The error is coming from /wp-includes/js/tinymce/themes/modern/theme.js line 2427:
elm.setAttribute(name === 'role' ? name : 'aria-' + name, value);
The error is 'Uncaught TypeError: Cannot read properties of undefined (reading 'setAttribute')'. The var
elm
here seems to have this opening tag (name
= 'role' andvalue
= 'button' - check source context for how vars are derived):<div id="mceu_50" class="mce-container mce-toolbar mce-stack-layout-item mce-first mce-last" role="toolbar">
The error prevents the whole metabox that the TinyMCE field is in from being rendered, and halts JS execution on the page.
This is with WP 6.1.1 (using multisite to run the client's main site and a subsite together), and CMB2 2.10.1.
I appreciate since this can't be replicated there might not be much you can do, but the issue has started happening recently (the site is a few years old), and I've spent so much time on it I need to move onto other work now and I'm posting on the off-chance it rings a bell for someone.
The text was updated successfully, but these errors were encountered: