getBlockTypes() do not return custom (PHP ?) blocks outside of the editor. #69214
Labels
[Feature] Blocks
Overall functionality of blocks
Needs Testing
Needs further testing to be confirmed.
[Type] Bug
An existing feature does not function as intended
Description
I'm following the "Create your First App with Gutenberg Data" tutorial".
Inside the main app file, I'm using the getBlockTypes() function from the
@wordpress/blocks
package, and it looks like the function do not return custom blocks, or at least, blocks registered with the PHPregister_block_type( $block_build_folder )
function. I get only core blocks.If i run
wp.data.select('core/blocks').getBlockTypes()
in the browser console inside the Editor (edit page screen for example), I got all the blocks, including customs blocks and PHP registered blocks.Step-by-step reproduction instructions
You must have a custom block, registered in PHP, activated on your site.
npm install
thennpm run build
wp.data.select('core/blocks').getBlockTypes()
Screenshots, screen recording, code snippet
No response
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: