Make WordPress Core

Opened 21 months ago

Last modified 21 months ago

#56627 new defect (bug)

Underscores are not allowed in block names; error message is misleading.

Reported by: skorasaurus's profile skorasaurus Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:


The error when activating a plugin containing a register block whose name contains an underscore is vague and misleading.

If you do not have WP_DEBUG set to true in your site's wp-config.php file; there are no errors in the browser's javascript console while in the editor.

When you have WP_DEBUG set to true; and activate the plugin that contains the block, the error message displayed is misleading; the message, included verbatim below, states that a namespace prefix must be used and in my test case block, a name space was used; create-block

"Notice: Function WP_Block_Type_Registry::register was called <strong>incorrectly</strong>. Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type Please see <a href="">Debugging in WordPress</a> for more information. (This message was added in version 5.0.0.) in /srv/www/case/public_html/wp-includes/functions.php on line 5831"

A testcase for a block named 'my_test_case' is available at
The block does has a namespace, create-block.

The full stacktrace for the error is at

This has happened to me in the past, has been reported in the [gutenberg issue tracker] (issue was closed and directed to report here)

Change History (2)

#1 @skorasaurus
21 months ago

An error message stating the allowed characters in a block name once existed; according to but the message no longer appears.

#2 @desrosj
21 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.