Support

Account

Home Forums Front-end Issues Uncaught TypeError: Cannot read property 'query' of undefined

Solved

Uncaught TypeError: Cannot read property 'query' of undefined

  • I get this error on line 4895 of acf-input.js when I click the “Add to Gallery” button.

    var Query = wp.media.query( options.library );

    This only occurs with the latest version of Chrome (45.0.2454.101 m) but is working on Firefox.

    Weird thing is that it works with the same version of Chrome using a local install of the same website with WAMPSERVER.

    I raised a support call about this but haven’t heard anything for a week…

  • Hi @tabboy

    Do you also have the latest version of WordPress and ACF? ACF Pro?

  • Yes I have the latest versions of both. I’ve raised this as a bug but I haven’t heard back for a couple of weeks.

  • Okay. Does the error disable the gallery button completely or is it just something that appears in the console while everything still works?

  • The error disables it completely and I can’t select any files for upload.

  • Hm okay,
    Could you try disabling all other plugins to make sure it’s not some interference?

    The error says wp.media doesn’t even exists.. so this happens when you click the “Add to gallery” button for a gallery field. But where? Is it on a post/page or something else?

  • It works with the same plugins on WAMPSERVER with Chrome but not on a hosted web server. Firefox works fine.

    Here is the where the gallery button is on a page.

    http://tradelaide.com.au/add-trade/

    Fails when I use Chrome on this page hitting the add to gallery button.

  • Okay,

    Can you provide a temporary login for me to try with? Currently it just tells me to login. You can post it as private here so only me and my coworkers in the forum can see it.

  • This reply has been marked as private.
  • This reply has been marked as private.
  • This reply has been marked as private.
  • Okay so I’ve tested now in both FF and Chrome (Version 45.0.2454.101) and I’m not getting the same error. I’m not getting any error but a few warnings about origins and the media button works.

    Is it possible you have some cached stuff in your browser? Perhaps you have an antivirus/malware-protection on your computer which does strange things (I’ve seen that before).

  • I’ve cleared all the browsing history and cache and it still doesn’t work in Chrome. It’s working on my mobile phone using Chrome but I have had other users claiming they also can’t add to the gallery with the Chrome browser…

    Not sure where to go next with troubleshooting this…

  • Hmm okay. You’re not experiencing the same issue with the regular media button in WP?

    If you add a wysiwyg field and click the media button, nothing?
    If you add a file field and click it? Image field?

  • I have a file field that displays in Firefox as the wp file uploader but in Chrome it displays as the basic type.

  • I’ve also tried it on tablet running Chrome and it doesn’t work. Tried it on my work PC and Chrome doesn’t load the media button on the single image upload.

  • I have a file field that displays in Firefox as the wp file uploader but in Chrome it displays as the basic type.

    So the file field is also not working properly in Chrome?

    I really don’t know what to tell you.. it works however and with whatever browser I try it and I’ve not encountered anyone with the same issue. I will assign @elliot to this topic too to see if he has any input.

  • That’s correct, it doesn’t work on any Chrome browser I have tried. I’m going to try and duplicate the site again and run it from my localhost because it has worked from there previously.

  • Okay let me know how it turns out.
    It sounds to be like some local problem with your chrome installation.. but still weird.

  • Not sure because the same chrome browser will display the controls on a localhost version of the site…

  • This is still an issue. I opened up a private thread with James but I have no idea how to respond to him now…

  • Hi Tabboy,

    Alright. I’m not sure since I’ve not used private threads at all yet 🙂

    You say it works in the same browser on a localhost tho. that kind off leads to the issue being with the specific server you’re hosted on.

  • It seems that way. I sent a login to one of the other support stuff on PM to see if he can replicate the issue. Do you want one also?

  • Thanks but at the moment I’m not as active support. I’m sure if you remind James he’ll help you out!

  • Hello,
    Has this issue been solved because I am getting the same error?

    Update: It’s ok. I’ve found the problem. It’s a user permission thing. I have to give file upload permission to non-admin users.

Viewing 25 posts - 1 through 25 (of 38 total)

The topic ‘Uncaught TypeError: Cannot read property 'query' of undefined’ is closed to new replies.