Map View not working (JS error)

Home Forums Calendar Products Events Calendar PRO Map View not working (JS error)

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #949848
    Peter Hoppe
    Participant

    Hi,

    Map View isn’t loading the pins and the list of events below the map show but the loader does not go away (so you can’t really click on an event – you see them behind the transparent loader, but that’s it.

    When I debug with Firefox, I get this on the console tab:
    TypeError: g.markers[i].setMap is not a function (which is coming from tribe-events-ajax-maps.min.js)

    All other plugins are removed and I have tried switching to the default TwentyFifteen theme. The Map View does work on TwentyFifteen, and I have contacted the theme developer to help fix what seems to be a theme conflict. He is willing to help but found the above error and would like help diagnosing the problem so that we can fix it. Here’s the message from the theme author:

    Thanks. The problem is, you’ve got JS error on the page, caused by the plugin, so markers are not displayed, and rest of the page is corrupted.

    It works fine on a default theme, but the error should be rather diagnosed by the plugin’s author, so I could at least know what might cause the plugin the problem in the theme. It’s hard for me to analyze the plugin myself.

    I’ve created a site to troubleshoot this bug and can provide login details in a private post.

    #949850
    Peter Hoppe
    Participant

    This reply is private.

    • This reply was modified 9 years ago by George.
    #949881
    George
    Participant

    Hey Peter,

    Thanks for reaching out to us here. A few things worth pointing out are that, while your willingness to share login information to resolve things more quickly is appreciated, we cannot log into user sites – I’ve removed the login information you posted here. Nobody has logged into your site thus far from our team, and nobody will – nothing personal, just an important security policy we follow to the letter! 🙂

    Now, as for your issues, your theme is definitely at least hugely at play here. If the issue is entirely resolved by doing nothing other than activating a default theme, that’s exceptionally strong evidence of this.

    However, that could mean many things, and could be an issue stemming from one script on your site or something.

    To help with investigation a bit here, can you head to your site’s wp-config.php file and add the following of code:

    
    define( 'SCRIPT_DEBUG', true );
    

    That might help us identify what exact instance of our Google Maps-related JS function deleteMarkers() is causing this specific error, which might help us figure out where things are failing.

    Let us know if you can make this change!

    Thanks,
    George

    • This reply was modified 9 years ago by George.
    #949978
    Peter Hoppe
    Participant

    Ok, I added that line of code to my wp-config.php file.

    #950205
    George
    Participant

    Hey Peter,

    I’ve been investigating this for quite some time this morning, and am failing to recreate this problem no matter what I try. While your theme developer is correct that the error is coming from our own JavaScript, it seems quite clearly to be directly caused by something from within the theme – if doing nothing else but activating Twenty Fifteen resolves these issues, that is very strong evidence of this.

    I’m not quite sure what the problem is. I noticed your theme is extending the Array prototype, and indeed the TypeError being thrown in Firebug is being thrown on the [empty] tg.markers Array. I’ve tried investigating possible issues with this and recreating them, but like I mentioned, I’ve failed.

    I know you’ve already contacted your theme developer, and am sorry if you feel like you’re caught in the middle of people who won’t help – we certainly don’t want you to feel that way, but I cannot recreate this error for the life of me (at least, up until this point), and the evidence is showing that something within your theme’s JavaScript is causing this failure.

    I’d recommend reaching out again to the theme developer, and share this information. Maybe they can test chunks of the everything.js file against these issues and see if that’s at fault, or try removing some of the third-party scripts included in the theme, just as a troubleshooting methodology to try and narrow down the specific culprit here.

    Sorry to disappoint or leave you frustrated Peter, this is an odd issue – there are some common things that cause TypeErrors, but I cannot produce theme here and I haven’t been able to identify the source of the problem.

    — George

    #950532
    Peter Hoppe
    Participant

    Thanks George. I sent this thread to the theme author and he came back with this:

    Indeed, the theme extends Array prototype with the following code, as stated in the last post of the topic you’ve shown

           Array.prototype.unique = function() {
               return this.filter(function(value, index, array) {
                   return array.indexOf(value, index + 1) < 0;
               });
           };
    

    but it should not affect plugin’s script. I was suspecting some conflict, so I’ve changed name of the function, but it’s the same. I don’t know what happens in the plugin, which causes the mess. I’m sorry we send you back and forward, but please consult what I wrote with the plugin support.

    #950608
    George
    Participant

    Hey Peter,

    Thanks for the update. I’m glad to hear the theme developer is equally frustrated in having you go back and forth between us, and on that note, I just wanted to mention that your patience has been extremely appreciated! 🙂

    Unfortunately, I’ve been unable to reproduce this error or discover what the cause of it could be specifically by reading through your theme’s source code. I think the end comments I left in my above reply still apply best here:

    Maybe they can test chunks of the everything.js file against these issues and see if that’s at fault, or try removing some of the third-party scripts included in the theme, just as a troubleshooting methodology to try and narrow down the specific culprit here.

    Sorry to disappoint or leave you frustrated Peter, this is an odd issue – there are some common things that cause TypeErrors, but I cannot produce theme here and I haven’t been able to identify the source of the problem.

    If you’re able to test the theme code manually like this yourself, or you can hear from your theme developer if they are able to test things this thoroughly, please let us know what you find. I will post an update here if I learn anything more, as well.

    Sorry for the frustration this is all undoubtedly causing Peter! Thanks for being patient and understanding thus far.

    Sincerely,
    George

    #950900
    Peter Hoppe
    Participant

    Hey George, the plugin developer said he did test the code in chunks and that the code pasted above is the snippet causing problems. Without that bit of code, the map view works fine. But with it, it does not. He said this snippet shouldn’t affect the plugin, but somehow it is. Any ideas?

    I forgot to mention it before, but yes, I’ve tested the code selectively, and the code I’ve pasted before is causing the problem in the plugin. Without this part all works fine. – Plugin developer

    #950902
    Peter Hoppe
    Participant

    This reply is private.

    #951194
    George
    Participant

    Hey Peter,

    You can send over the theme .zip by uploading it to a download site like Dropbox, or http://ge.tt, or something similar – just be sure to check the “Set as Private Reply” option for the reply that has that link, so that only you and us here on the support team can actually see the link for that premium product 🙂

    As for the comments from your developer, just to be 100% clear, he means this bit of code here?

    
    Array.prototype.unique = function() {
       return this.filter(function(value, index, array) {
           return array.indexOf(value, index + 1) < 0;
       });
    };
    

    I just want to be clear on that because this is a huge step forward in resolving this issue, if simply removing that code resolves things here. Let me know, and share a .zip of the theme if you can.

    Peter – thanks for relaying stuff back and forth between us here. I know how frustrating issues like this can be so your patience is really appreciated. Thank you!

    Hopefully we can get things working. 🙂

    Cheers,
    George

    #951218
    Peter Hoppe
    Participant

    This reply is private.

    #951220
    George
    Participant

    Thanks Peter!

    #951229
    Peter Hoppe
    Participant

    Yes, sir. I really appreciate you guys helping get this fixed. Thanks again.

    #951239
    George
    Participant

    No problem Peter, we’ll take a closer look and see what we can find. Stay tuned!

    #951770
    George
    Participant

    Hey Peter,

    Just wanted to give you an update that we’re still looking into this and will hopefully have an update soon! Just didn’t want you to think we dropped off the map 🙂

    Cheers,
    George

Viewing 15 posts - 1 through 15 (of 20 total)
  • The topic ‘Map View not working (JS error)’ is closed to new replies.