Home Forums WoodMart support forum Critical JavaScript Error: ‘jQuery is not defined’ causing conflicts

Critical JavaScript Error: ‘jQuery is not defined’ causing conflicts

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #683437

    mediok.com.ua
    Participant

    Hello Woodmart Support Team,

    We are experiencing a ReferenceError: jQuery is not defined on our site. The browser console indicates that the error occurs when our custom JavaScript block is executed.

    However, our custom script is written according to WordPress standards, using the recommended jQuery(document).ready(function($) { ... }); no-conflict wrapper to prevent such issues.

    The strange thing is, this conflict only happens when the Woodmart theme is active. When we switch to a default WordPress theme like “Twenty Twenty-Four”, the error completely disappears, and our script works perfectly.

    This leads us to believe there might be a specific script loading order in Woodmart that is causing this conflict. Could you please provide some guidance or insight on why this might be happening and how to resolve it? We have already tried disabling plugins and clearing all caches.

    Thank you for your time and assistance.

    #683670

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Thanks for reaching to us and appreciate your patience.

    To assist you in the best possible manner, I kindly ask that you please provide me temporary wp-admin info (wp-admin URL, username, password) to the Private Content area, this will allow me to thoroughly investigate and address your concerns more efficiently.

    Regards,
    Hung PD

    #683763

    mediok.com.ua
    Participant

    Hello Hung PD,

    Thank you for your reply.
    I have just generated a temporary login link for you. You can find it in the private content area below.

    Thank you for your help.

    #684072

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Thanks for details and appreciate your patience.

    Please confirm me back if you resolved the issue https://ibb.co/zV3Xw69m

    Regards,
    Hung PD

    #684268

    mediok.com.ua
    Participant

    Hello Hung PD,

    Unfortunately, the issue is not resolved. After placing the final tracking scripts, the original error has returned: Uncaught ReferenceError: jQuery is not defined.

    The console shows the error occurs in an inline script right after your theme’s helpers.min.js file is loaded. This confirms that the jQuery library is still not being loaded correctly by the theme before other scripts require it.

    Could you please investigate this again? The site is still breaking and preventing critical tracking from functioning.

    Thank you.

    #684280

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Could you please record a short video of the problem so we can better understand what is wrong?

    Thanks for your patience.

    Regards,
    Hung PD

    #684517

    mediok.com.ua
    Participant

    Hi Hung PD,

    Thank you for looking into it. I have discovered new, critical information.

    The jQuery is not defined error only appears for logged-out visitors. When I am logged in as an admin, the error is gone, but for any regular user, the site is still broken.

    I have recorded a new video to prove this. You can see me logged in with a clean console, and then I log out, and the error immediately returns.

    This means the fix is not working correctly for the public-facing site, and my tracking scripts are still failing for all my customers. Please investigate this logged-out vs. logged-in issue.

    Regards,

    Attachments:
    You must be logged in to view attached files.
    #684621

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Can you please create for me an admin account then I can follow your video? Also, it is possible to switch to default theme, deactivate plugins for testing?

    Regards,
    Hung PD

    #684664

    mediok.com.ua
    Participant

    Hi Hung PD,

    Thank you for your reply. Yes, of course.

    I have created a temporary admin login link for you. It will expire in 7 days. You can find the link in the private content area below.

    You have my full permission to switch to the default theme and deactivate plugins for testing, just as I did in the video. The site is backed up.

    Please let me know once you have found the solution.

    Thank you!
    Regards,

    #684906

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Thanks for your patience.

    I mean that provide me admin account instead. According to the video, an issue occurred when you logged in.

    Regards,
    Hung PD

    #686075

    mediok.com.ua
    Participant

    Hi Hung PD,

    Thank you for the quick reply. I want to clarify a very important point: the JavaScript error occurs only when a user is **LOGGED OUT**. When I am logged in as an admin, the error disappears. The video I sent demonstrates this.

    As requested, here are the temporary admin credentials. They will be deleted after the issue is resolved.

    You have my permission to deactivate plugins and switch themes for testing.

    Thank you for your help.
    Regards,

    #686245

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    Thanks for your patience.

    It caused by WP Rocket plugin. I kindly recommend you to go through each options to deactivate and re-activate to find which caused the issue.

    Regards,
    Hung PD

    #686547

    mediok.com.ua
    Participant

    Hi Hung PD,

    Thank you for investigating.

    I understand you suspect WP Rocket, but we have already performed extensive testing that shows the issue is within the Woodmart theme itself.

    As shown in the video I sent previously, the jQuery is not defined error **completely disappears** when we switch to a default WordPress theme (like Twenty Twenty-Four), **even with the WP Rocket plugin still active**. The error only appears when the Woodmart theme is active.

    We also tried deactivating the key JavaScript optimization features within WP Rocket (like “Delay JavaScript execution”), and the error still persisted with the Woodmart theme active.

    This indicates a fundamental script loading order issue in the theme that is incompatible with standard optimization plugins like WP Rocket, especially for logged-out users.

    Could you please re-investigate the theme’s script enqueueing for logged-out users?

    Thank you for your continued support.
    Regards,

    #686692

    Hung Pham
    Keymaster

    Hi mediok.com.ua,

    I’ve passed this topic to one of our developers, and I will let you know once get an answers.

    Thanks for your patience.

    Best Regards,
    Hung PD

    #686767

    Hung Pham
    Keymaster

    Hi Hung PD,

    After a more detailed check of your issue, we can confirm that the problem was caused by WP Rocket in combination with your custom JS code. In order for your code to work correctly, it was necessary to add jQuery to the Excluded JavaScript Files list in the WP Rocket settings https://monosnap.com/file/KNszRqtH4W6ThRw0H6X5LehQJK27C3.

    We have already applied this change, and now the error on your website is gone. You can verify it.

    Regards,
    Hung PD

Viewing 15 posts - 1 through 15 (of 15 total)