• Resolved Asif

    (@asif_rn)


    Hi,

    I’m getting this error message in my devtools console whenever I scroll to the embedded map: “Uncaught ReferenceError: wp is not defined”

    The plugin is working fine otherwise except showing this error message.

    • This topic was modified 1 year ago by Asif.
Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Hi, A link to the site, where I can see the error, would be a big help.

    Thread Starter Asif

    (@asif_rn)

    You can visit this page to see the issue: https://aksgar.me/snowdonia-to-llandudno-family-adventures-in-north-wales

    There are three maps embedded and all of them show this in the devtools console.

    Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Hi,

    This may be because you’re using rocket loader to load the scripts. You can check if that’s the issue by temporarily disabling rocket loader completely. If so, try excluding the MapPress scripts from it.

    Thread Starter Asif

    (@asif_rn)

    The issue stays even if I disable rocket loader. In fact the very first thing I did was to check the script after disabling rocket loader and it was there.

    Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Great, leave rocket loader disabled so I can check the site again, or use the contact form to send a login (a staging site with the same issue will also work) and I’ll toggle it on and off as needed.

    Thread Starter Asif

    (@asif_rn)

    I have disabled the rocket loader for the time being. You can see the error is still there. The maps works fine though.

    Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Thanks – but now it looks like now autoptimize is modifying the scripts. Probably the easiest thing is to temporarily deactivate ALL other plugins and see if you have the message. If not, reactivate one by one to find the conflict.

    This doesn’t appear to be a MapPress issue, but if you find that it is please let me know.

    Optimizing Matters

    (@optimizingmatters)

    pro-tip; you can disable Autoptimize on a per-request basis by adding ?ao_noptimize=1 to the URL.

    if the problem is not there at that point, some autoptimize (re-)configuration might be needed to fix this. there are troubleshooting tips and info on how to exclude in the AO FAQ.

    hope this helps debugging,
    frank (ao dev)

    Thread Starter Asif

    (@asif_rn)

    @optimizingmatters – How do I disable Autoptimize for MapPress?

    I added “wp-content/plugins/mappress-google-maps-for-wordpress/” in “Exclude scripts from Autoptimize” but this didn’t work.

    Optimizing Matters

    (@optimizingmatters)

    looks like mappress requires the WP object to be available early, try adding wp-includes/js to the JS optimization exclusion list maybe?

    Thread Starter Asif

    (@asif_rn)

    @optimizingmatters tried that but the error stays there.

    Optimizing Matters

    (@optimizingmatters)

    let’s take it a step back; when disabling “aggregate JS” the problem is not there any more, or is it?

    Thread Starter Asif

    (@asif_rn)

    Just disabled it and the error is still there.

    Optimizing Matters

    (@optimizingmatters)

    do you have “async javascript” (older plugin in my “portfolio”) active and if so can you disable it?

    Thread Starter Asif

    (@asif_rn)

    Disabled it and the error is gone now!

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘Error: wp is not defined’ is closed to new replies.