• Resolved cltil

    (@cltil)


    I use the W3 Total cache plugin and I have a problem with some pages, the following errors appear:

    jQuery.Deferred exception: Cannot read properties of undefined (reading 'indexOf') TypeError: Cannot read properties of undefined (reading 'indexOf')
    
    Uncaught TypeError: e.parents(...).initPhotoswipe is not a function
    
    jquery.min.js:2 
    Uncaught TypeError: Cannot read properties of undefined (reading 'indexOf')

    These are identical elements that appear on all pages on the site, but this problem occurs on some pages. What should be done in the settings to solve this?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @cltil

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    Can you please share your website URL?
    Also, can you please share if Minify is enabled in Performance>General settings and if so, disable it, save all settings and purge the cache, and see if the problem persists?
    If the problem is gone, you have most likely deferred the minified files which include jQuery. In this case, you should exclude the jQuery file from being minified, by adding the path to the jQuery file to Performance>Minify>Advanced>” Never Minify following JS files”
    /wp-includes/js/jquery/jquery.min.js
    The reason for this is because in some cases, some files that are dependable on jQuery need to lad after jQuery

    Let me know if this helps!

    Thanks!

    Thread Starter cltil

    (@cltil)

    Thanks for your response Marko! Minify was indeed running, but I disabled it as you wrote and even after clearing the cache it doesn’t help. Any other ways to solve this?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @cltil

    Thank you for your reply.
    Minify should be the only reason for potential issues with jquery.
    Can you please temporarily disable the W3 Total Cache and see if the problem persists?
    If the problem is gone, please disable the settings one by one in Performance>general settings, save the settings and purge the cache after each setting is disabled, and see which one might be causing the issue.
    If the problem persists after disabling the W3 Total Cache, then the issue is not related to W3TC.

    Thanks!

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

The topic ‘Urgent: Uncaught TypeError’ is closed to new replies.