Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get property 'getPlacePredictions' of undefined or null reference #382

Open
adrienharnay opened this issue Mar 6, 2018 · 3 comments

Comments

@adrienharnay
Copy link

adrienharnay commented Mar 6, 2018

Short description

I have Sentry reports about an error, with the following code snippet:

is.props.country}),this.setState({isLoading:!0},function(){e.autocompleteService.getPlacePredictions(t,function(t){e.setState({isLoading:!1}

Expected results

No runtime error

Actual results

After investigating, it comes from this line, when this line "fails" and this.autocompleteService is null. It happens mostly when the user has a flaky Internet connection.

Reproduction steps

  1. Launch the live demo
  2. Make the call to GMaps fail with bad connection
  3. Witness the error in console

Additional Information

I am available to do a PR if you want, but would need to discuss context beforehand (should the suggest fail silently, or retry until it succeeds, or...).

Thanks in advance!

Edit: exactly the same with this line because this line also fails, producing this snippet:

ps.country?{country:this.props.country}:null},this.geocoder.geocode(o,function(o,n){if(n===t.googleMaps.GeocoderStatus.OK){var r=o[0],i=r.ge
@ro-ka
Copy link
Contributor

ro-ka commented May 22, 2018

Thanks for bringing this up! Maybe retry three times and then fail? Feel free to open a PR!

Sorry for the delay, I was on parental leave the last months.

@mynameiswillporter
Copy link

This happens for me 100% of the time.

@ro-ka
Copy link
Contributor

ro-ka commented Jul 23, 2018

@mynameiswillporter That’s sad. But as I mentioned before, you’re free to implement a retry and open a PR. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants