• Description:
    Hello,

    I am experiencing an issue with the Shortcoder Gutenberg block. When I add the block to a post and click the “Select shortcode” button, nothing happens.

    Upon inspecting the browser console, a JavaScript error is triggered immediately upon clicking. I traced it in the debugger and found the exact line causing the issue in index.js.

    Error Log:
    Uncaught TypeError: Cannot read properties of null (reading ‘value’)

    The problematic code in index.js:

    onClick: () => {
        if (window.sc_show_insert) {
            // The error occurs on the following line:
            var e = document.getElementById("shortcoder-input-" + s).value;
            window.sc_show_insert(e, s)
        }
    }



    Cause:
    document.getElementById(“shortcoder-input-” + s) is returning null (likely because the element cannot be found in the DOM, possibly due to the block editor’s iframe canvas in newer WP versions), and accessing .value on it throws the TypeError.

    Steps to Reproduce:

    Open the Gutenberg block editor (adding a new post/page).

    Insert the “Shortcoder” block.

    Click the blue “Select shortcode” button.

    The UI does not respond, and the console throws the TypeError.

    Environment & Troubleshooting Performed:
    To rule out conflicts, I used the official Health Check & Troubleshooting plugin. The issue perfectly isolates to Shortcoder.

    Active Theme: Twenty Twenty-Four

    Active Plugins: ONLY Shortcoder (all other plugins disabled via troubleshooting mode)

    Cache: Completely cleared CDN and local browser caches.

    Could you please look into updating this DOM selection method to be compatible with the current block editor environment? Let me know if you need any additional information. Thank you!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this review.