Google Maps block: kbInitMaps is not a function wit Javascript API option is on
-
Hi folks,
I noticed the Google Maps block throwing an error in the console when the “Use Javascript API” option is active. It works fine when this option is disabled.
This is how I encountered the error in WordPress 5.9 with Twentytwentytwo theme:
- Put the Google Maps block in a page. Enter a valid API key and save everything. Leave the “Use Javascript API” option disabled. The map shows up both in the editor and on the front end. Perfectly fine.
- Activate the option “Use Javascript API”. Save and update everything. The map does not show up on the front end anymore but is visible in the block editor. There is a blank space where the map would normally be.
The error in developer tools console reads:
Uncaught (in promise) Object { message: "kbInitMaps is not a function", name: "InvalidValueError", stack: "ne@https://maps.googleapis.com/maps/api/js?key=[I-REMOVED-MY-API-KEY-HERE]&callback=kbInitMaps&ver=2.3.0:66:280\n_.pe@https://maps.googleapis.com/maps/api/js?key=[I-REMOVED-MY-API-KEY-HERE]&callback=kbInitMaps&ver=2.3.0:66:391\nBea@https://maps.googleapis.com/maps/api/js?key=[I-REMOVED-MY-API-KEY-HERE]&callback=kbInitMaps&ver=2.3.0:197:241\nCea/<@https://maps.googleapis.com/maps/api/js?key=[I-REMOVED-MY-API-KEY-HERE]&callback=kbInitMaps&ver=2.3.0:197:127\n" }
Any ideas why?
PS: I tried more than 1 Google Maps Javascript API key. None worked.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Google Maps block: kbInitMaps is not a function wit Javascript API option is on’ is closed to new replies.