• After a recent WordPress/WooCommerce update, Jetpack Boost’s Defer Non-Essential JS is causing these console errors:

    • NotSupportedError: Failed to execute ‘define’ on ‘CustomElementRegistry’: the name “wc-order-attribution-inputs” has already been used
    • TypeError: Failed to execute ‘getComputedStyle’ on ‘Window’: parameter 1 is not of type ‘Element’ (Astra theme)

    This happens because Jetpack Boost defers WooCommerce’s order-attribution.min.js, which registers a custom element. Since JS is deferred and reordered, the script sometimes loads twice or loads after Astra calls it.

    Is there a way to exclude specific JS files (like WooCommerce’s order attribution script) from Defer, or adjust the Defer logic to avoid loading this script multiple times.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @alienjackhammer,

    To exclude specific JavaScript files from being deferred by Jetpack Boost, you can try adding the attribute data-jetpack-boost="ignore" to the script tag of the WooCommerce order attribution script. If the script is enqueued using wp_enqueue_script, you can modify it in your theme’s functions.php file.

    For more details, please refer to Exclude JavaScript files from Jetpack Boost deferral.

    Hope that helps! If you need further assistance, feel free to reply to this thread.

    Thank you!

    Thread Starter alienjackhammer

    (@alienjackhammer)

    Thanks for the response. I did try this and unfortunately, no success. After messing with it for an hour or so; it effectively stopped the JS from running at all. I’m not sure what is causing this… whether it’s Jetpack, WordPress or WooCommerce. But, I’m sure I can’t be the only one experiencing this issue. Since there was a WP and Woo update nearly at the same time; it is hard to debug what broke what. It’s not a huge enough deal to rollback to a previous version(s). If you have any additional clues in the future; let me know.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi @alienjackhammer,

    Thanks for the details – sorry our previous suggestions didn’t work out. Adding the ignore attribute is indeed the correct approach for scripts that shouldn’t be deferred. If that didn’t resolve the issue, it’s likely that the attribute wasn’t applied to the exact script WooCommerce needs for order attribution.

    Unfortunately, identifying the specific script causing the conflict can be quite difficult, and falls outside the scope of what Jetpack Boost can safely handle on a case-by-case basis. If you’re comfortable digging in, you can try applying the ignore attribute to different WooCommerce attribution scripts until the checkout flow works again.

    Otherwise, the simplest option is to keep Defer non-essential JavaScript turned off to avoid the conflict altogether.

    Hope that helps! Let me know if there’s anything else we can do to help 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.