WordPress / gutenberg-examples

Examples for extending WordPress/Gutenberg with blocks.
1.2k stars 316 forks source link

Missing dependency in gutenberg-examples/blocks-non-jsx/01-basic/block.asset.php #238

Closed nedkelly closed 1 year ago

nedkelly commented 1 year ago

Hey, these examples are really helpful, thanks for your efforts.

I tried setting up the basic non-jsx example but kept getting a console error Uncaught TypeError: Cannot read properties of undefined (reading 'useBlockProps'), I noticed that the block.asset.php file was missing the wp-block-editor dependency so I added it and the block began working.

<?php return array('dependencies' => array('wp-blocks', 'wp-element', 'wp-i18n', 'wp-block-editor'), 'version' => 'a35cc1c098b69994c9c6d6dc1416bb90');

Cheers.

ryanwelcher commented 1 year ago

This was fixed with #240