Skip Navigation

[Resolved] Updated site and now get “Uncaught ReferenceError: google is not defined”

This thread is resolved. Here is a description of the problem and solution.

Problem: After updating, I see an error "Uncaught ReferenceError: google is not defined" in the console and no maps appear on the front-end.

Solution: Update plugins, WordPress, and theme.

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Eric 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1178640
sceenshot-2019-01-06_12-50-54_PM.png

I am trying to: create a view of a custom post type that has a location that I would like to show the map of upon viewing the post type

Link to a page where the issue can be seen: hidden link

I expected to see: a map and a marker

Instead, I got: no map and an error "Uncaught ReferenceError: google is not defined" in the console (see attached image)

Additional notes: I recently updated my site to WP 5.0.2 as well as Toolset (Types and Views) and theme Avada 5.7.2 and I was not having the Google Maps issue and error. I attempted to add the optional 2nd Key to the Toolset > Maps > Settings area and I am not able to update or click the "Check API" button on the page.

#1178647

Hi, please try the following troubleshooting steps first:
- Clear your browser cache, log out, and log back in. Test again.
- Temporarily deactivate all plugins except Types, Views, and Maps. Activate a default theme like Twenty Nineteen, then test again.
- If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem is not resolved, I'll be glad to take a closer look.

#1178669

Yeah, as expected it is the Avada theme... unfortunately this leaves little room for me and my client as I can't undo the theme selection.

I can begin the process of figuring out which version of Toolset Types / Views gets broken by which Avada version, but could you all take a look. I'm sure that I will likely not be the only person with this issue...

Thanks.

#1179161

I'm running some map tests locally with Avada 5.7.2 and I'm not experiencing the same error you described. Can you tell me:
- Are you using a custom map style / JSON file? If so, can you share it?
- Go to Avada > Theme Options > Advanced > Theme Features and tell me if toggling the Google Maps script setting has any effect.
- Go to Avada > Theme Options > Advanced > Dynamic CSS and JS, and reset Fusion caches.
- Also in Avada > Theme Options > Advanced > Dynamic CSS and JS, temporarily disable the JavaScript compiler if it's in use.

Please let me know the results of these tests.

#1180258

I attempted each of your suggestions w/o success.

In the Avada > Contact form > Google Map Styling - I did have that set to Custom, but switching it back to the Default Styling did not change the error. I left that setting at Default Styling before doing the other recommended tests.

Note, we are also using a CDN and Breeze plugin for caching. Just in case, I turned these off as well when doing the tests.

Anything else I can take a look at?

#1180268

If there's any custom JavaScript code in any of these locations, you can try temporarily commenting it all out:
- Theme options like field code, tracking code
- Layouts JS
- Views editor JS panels
- etc.

If none of these solves the problem, I can try making a clone of your site to run some additional tests. I'll activate private reply fields here so you can share login credentials with me if necessary.