Support

Account

Home Forums Backend Issues (wp-admin) New block.json method yields "no block types exist" Reply To: New block.json method yields "no block types exist"

  • Good afternoon mates. I contacted support and they gave me a solution that worked for me.

    I share it with you. Luck

    ——————————————————————————

    The register_block_type() expects a filesystem path(as illustrated at https://drive.google.com/file/d/1j_IaTnRnEJLFraiUKsYrdi5yEhWSkzy8/view?usp=sharing).

    That said, please try using the __DIR__ . ‘/path-to-the-block-file.json ensuring the complete path to .json file is added. For example:
    register_block_type( __DIR__ . ‘/blocks/testimonial/block.json’ );

    In other words, you can try replacing get_template_directory_uri() with __DIR__ or get_template_directory() in block registration code.

    Also, confirm if the path returned resolves to your /block.json file.