Uncaught (in promise) be {message: ‘wpslCallback is not a function’,
-
Google maps now requires a callback which was implemented in the 2.2.237 update, but this can cause JS errors if your using caching / optimization plugins since they sometimes change the loading order of the JS files.
The expected load order is this.
1) wpsl-gmaps.js ( this includes the wpslCallback function )
2) maps.google.com with the wpslCallback function.
If the code if minified / optimized it can turn into the order below, which will cause the Uncaught (in promise) be {message: ‘wpslCallback is not a function’, error.
1) maps.google.com
2) all-other-js-files.js
This can often be fixed by excluding the page where you used the [wpsl] shortcode from being optimized, or just exclude the wpsl-gmaps.js file from being minified / combined. The exact location where you can do this depends on the used plugin.
If your don’t use any caching / optimizations plugins, then check if the ‘Use the default style for the info window?’ option is disabled on the WPSL settings page.
For some users enabling it fixed it. I haven’t been able to replicate this myself, so if changing that option fixes the issue for you, then please open a support ticket and let me know the list of active plugins / active theme name so I can investigate this further.If your using the Complianz plugin, then make sure to update to the latest version.
- The topic ‘Uncaught (in promise) be {message: ‘wpslCallback is not a function’,’ is closed to new replies.