• Santosh Gautam

    (@santoshgautam)


    Hi Plugin Author/Support Team,

    I am facing an issue with the tracking page in your plugin. The page is throwing the following error in the browser console:

    Uncaught TypeError: Cannot read properties of undefined (reading 'addEventListener') at track-order/:1401:68

    From my investigation, it looks like the JavaScript code is trying to attach an addEventListener to an element that is not yet available in the DOM at the time the script runs. Because of this, the element reference becomes undefined/null and the script fails.

    Possible causes:

    • The script is executing before the DOM is fully loaded.
    • The element ID/class used in the script is missing or incorrect.

    Possible solutions:

    • Wrap the code inside document.addEventListener("DOMContentLoaded", ...) to ensure the element exists before attaching the event listener.
    • Add a condition to check if the element exists before calling addEventListener.
    • Alternatively, move the script to the footer so it executes after the DOM is ready.

    Could you please check and provide a fix in the plugin update?

    Thanks & Regards,
    Santosh Gautam

    [email protected]

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

Viewing 1 replies (of 1 total)
  • Plugin Contributor amitmital

    (@amitmital)

    Hi Santosh,

    Thank you for reporting this issue. We are checking this and will give you an update soon.

    Regards,

    Amit

Viewing 1 replies (of 1 total)

The topic ‘Issue: Tracking Page Script Error (DOM Load Issue)’ is closed to new replies.