Google API Errors 'MissingKeyMapError' & 'NoApiKeys' on front end when back office datatypes report valid key?
Jonathan, et al,
The synopsis is I'm running into this issue on a clients site that's
just gone live.
Before repointing the live domain to the staging server (no comments
please) everything worked fine.
Please note, there are no http restrictions on any of the keys we've
used.
So we went live and the maps API threw the MissingKeyMapError and NoApiKeys errors so I hid the map on the front end while bug-checking.
I changed the keys to newly generated ones
Then the back office threw a hissy fit and told me the key was invalid:
Note: At this time the console also told me that there was Uncaught reference error: google is not defined and Uncaught TypeError: Cannot read property 'maps' of undefined errors but these make sense
as the key was working as expected.
So I had the client generate a new one from their account and everything in the back office is green again!
BUT
The front end is still showing the same errors?
I've also tried to change the version of Maps being loaded but still receive the same error?
Has anyone run into this before?
Any ideas out be greatly appreciated!
J
N.B. There are Analytics and ReCaptcha running on this site too and no one has reported any issues with those Google services?
@Alex, thanks for responding! I forgot to come back to update the issue as it turned out that the maps script wasn't actually using the Terratype loader but they're own custom javascript one - which wasn't passing the key to the api?
Needless to say, I commented out their element that was targeted by the
javascript and added the usual @Html.Terratype(mapAlias) to the template and low and behold it works!
I'll mark this as the solution so we know it's sorted!
Google API Errors 'MissingKeyMapError' & 'NoApiKeys' on front end when back office datatypes report valid key?
Jonathan, et al,
So we went live and the maps API threw the
MissingKeyMapError
andNoApiKeys
errors so I hid the map on the front end while bug-checking.I changed the keys to newly generated ones
Then the back office threw a hissy fit and told me the key was invalid:
So I had the client generate a new one from their account and everything in the back office is green again!
BUT
The front end is still showing the same errors?
I've also tried to change the version of Maps being loaded but still receive the same error?
Has anyone run into this before?
Any ideas out be greatly appreciated!
J
N.B. There are Analytics and ReCaptcha running on this site too and no one has reported any issues with those Google services?
Have you got a snippet of your Razor code for the front-end?
@Alex, thanks for responding! I forgot to come back to update the issue as it turned out that the maps script wasn't actually using the Terratype loader but they're own custom javascript one - which wasn't passing the key to the api?
Needless to say, I commented out their element that was targeted by the javascript and added the usual
@Html.Terratype(mapAlias)
to the template and low and behold it works!I'll mark this as the solution so we know it's sorted!
is working on a reply...