I'm using the Set My Location block on the homepage of my site. IPGV&M is configured to use a Maxmind lookup with the Google HTML5 fallback. When the HTML5 Location comes in, the Set My Location block refreshes and the user's specific location is displayed. In the console, ip_geoloc_current_location.js reports the time it took to locate the visitor and reverse geocode the address. Immediately after that ip_geoloc_current_location.js logs an error that reads
IPGV&M, ip_geoloc_current_location.js parsererror: SyntaxError: Unexpected end of input (200)
The error is being thrown by the AJAX call in the callbackServer function on line 94 of ip_geoloc_current_location.js, and prevents any other JS from executing on the Set My Location block. I have also tried version 7.x-1.28 and received the same error.
Comments
Comment #2
rdeboerHi Drew,
Thanks for your report.
"IPGV&M is configured to use a Maxmind lookup with the Google HTML5 fallback". You mean
"IPGV&M is configured to use the Google HTML5 lookup with Maxmind as a fallback"?
Not that it matters, as it sound like it doesn't get to the fallback...
This is the first time I've heard of this error. Wondering whether it's the data? Is it location dependent? Or does it always happen no matter where you are? I'm wondering whether the code doesn't properly escape "funny" characters in the location string.
Does the error happen when you press "Find me" or do you have the periodic HTML5 repeat on as well? Just wondering what it is that triggers it.
Rik
Comment #3
drewble commentedRik,
Thanks for your help!
Sorry about getting my wording mixed up on which service is the fallback. You have it right.
I don't think that this error is location dependent. I have been traveling a lot over the last few weeks and I have received the same error in every location. The error also happens when I press "find me." The odd thing to me is that the block and the data all work and come through properly, but an error is thrown at the very last second. I have tried debugging in that function to see at what point the error is thrown, but all I have been able to determine is that it happens in the jQuery.ajax call of the callbackServer function.
Comment #4
rdeboerHi Drew,
Well at least it doesn't seem to affect functionality.
Still, strange...
I haven't heard about this error before... So am at a loss. Interference with... yeah with what?
Maybe someone else out there in the community finds this issue and has a clue...
Not sure where to start at the mo'... and do not have a reproducible test-case on my laptop.
Rik
Comment #5
mariano.barcia commentedChipin' in, I'm also getting this error now.
6.828 s to locate visitor ip_geoloc_current_location.js:37:1
0.02 s to reverse-geocode to address ip_geoloc_current_location.js:78:1
IPGV&M, ip_geoloc_current_location.js parsererror: SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data (200) ip_geoloc_current_location.js:126:11
AJAX call completed with parsererror ip_geoloc_current_location.js:133:9
I've been getting this while I'm developing a new site. This is the first time I use this module, but not my first drupal website ;-)
I haven't been able find the time to track this down. I will keep you updated, thank you in advance.
Comment #6
mariano.barcia commentedSo this wasn't happening on Bartik, but on a custom theme.
I got it working. I've added 2 lines to the bottom of the callback function ip_geoloc_current_location_ajax_recipient(), just before returning
Not sure why it would work on Bartik and not the other theme though.
Comment #7
rdeboerGreat work Mariano,
Will add to the module ASAP.
Rik
Comment #8
sistro commentedHi guys,
I have the same error, the fix provided by Mariano works also for me!
Thanks!
Comment #9
rdeboerPatch applied.
Thanks Mariano.
Thanks sistro for confirming the fix.
Rik
Comment #11
rdeboerComment #12
rdeboer