• Resolved lucamortellaro98

    (@lucamortellaro98)


    Hi everyone,

    I’m facing an issue with Lazy Blocks version 3.8.2 on my WordPress site running version 6.7.1. When I try to interact with or preview my blocks in the editor, I get the following error message:

    “This block has caused an error and cannot be previewed.”

    Additionally, the browser console shows the error:

    First argument must be a String, HTMLElement, HTMLCollection, or NodeList

    This error seems to be originating from the file /wp-includes/js/dist/compose.min.js?ver=85f0708cd2e6b26addeb on line 9.

    Here’s what I’ve tried so far to resolve the issue:

    1. Updated WordPress to 6.7.1 and Lazy Blocks to 3.8.2.
    2. Disabled all other plugins except Lazy Blocks and switched to a default WordPress theme (Twenty Twenty-One) to rule out theme/plugin conflicts.
    3. Checked custom JavaScript in my blocks to ensure proper DOM references and no missing elements.
    4. Cleared the browser cache and tried incognito mode, but the issue persists.

    Despite these efforts, I’m unable to preview or interact with any blocks, and the error remains across multiple blocks.

    Has anyone encountered this specific issue with these versions? Any suggestions or fixes would be greatly appreciated!

    Thanks in advance for your help!

    Best regards,

    Luca

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Alex

    (@fellan91)

    Hello,

    I checked but couldn’t reproduce the error. The issue might occur if you’re placing the URL Control inside the content: https://shot.nkdev.info/Y8NLYYl6tT4J9444QKmB
    This will cause a rendering error and crash the block. This is a known issue that affects new themes but not older ones. It’s related to the Gutenberg editor frame’s functionality and appears in various situations. While we attempted to restrict control selection through the interface, we likely didn’t add enough conditions to block this field properly.

    If you encounter this error, try moving the URL Control to the inspector. Plugins and themes can disable Gutenberg’s features and let you skip it, but this approach may cause problems and is not recommended.

    PS: If you encounter an error caused by other factors, please export the problematic block to me for testing in my system. You can find export instructions here: https://www.lazyblocks.com/docs/export-blocks/

    Regards,
    Alex

    Good morning! I was encountering this same error, so I started investigating and running some tests and discovered the source of the issue. It only occurs when you add a field of the URL type. I hope this helps you.

    Best regards,
    Rafael

    Thanks for the tip with the URL field, but why is the issue marked as resolved?

    • This reply was modified 1 year, 1 month ago by Tim.
    Plugin Support Alex

    (@fellan91)

    Hello,

    Please read this thread and my colleague’s conclusion at the end: https://github.com/nk-crew/lazy-blocks/issues/296#issuecomment-2012043228

    “Since the iframe editor was introduced in Gutenberg, some components have stopped working correctly inside the content. Initially, inserting input fields inside the block content was not in the Gutenberg paradigm, but we decided to make it possible. I think we have to use controls in the Inspector and stop using them in content. We should also add the possibility of using the RichText component (https://developer.wordpress.org/block-editor/reference-guides/richtext/), which is Gutenberg’s preferred method to edit elements in the block output directly.”

    You can also read this threads:

    We plan to implement stricter limitations on URL field insertions in block content, unless Gutenberg resolves this issue first. Currently, we cannot influence WordPress editor development since we are not Gutenberg’s core contributors.

    I have marked the issue as resolved. We have fully investigated the problem and documented it in our issue tracker.

    PS: If Gutenberg makes any progress, we can reopen and revisit this issue. However, currently there are no signs of advancement.

    Regards,
    Alex

    • This reply was modified 1 year, 1 month ago by Alex.
    • This reply was modified 1 year, 1 month ago by Alex.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Error: ‘This block has caused an error and cannot be previewed’’ is closed to new replies.