React-native-google-places-autocomplete: Web support example timeout

Created on 11 Jan 2021  路  6Comments  路  Source: FaridSafi/react-native-google-places-autocomplete

Describe the bug

Using the web support example, autosuggestions work on ios, but not on the web. The web console shows a timeout

Reproduction - (required - issue will be closed without this)

import React from 'react';
import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete';

const GooglePlacesInput = () => {
  return (
    <GooglePlacesAutocomplete
      placeholder='Search'
      onPress={(data, details = null) => {
        // 'details' is provided when fetchDetails = true
        console.log(data, details);
      }}
      query={{
        key: 'YOUR API KEY',
        language: 'en',
      }}
      requestUrl={{
        useOnPlatform: 'web', // or "all"
        url:
          'https://cors-anywhere.herokuapp.com/https://maps.googleapis.com/maps/api', // or any proxy server that hits https://maps.googleapis.com/maps/api
      }}
    />
  );
};
export default GooglePlacesInput;

Please provide a FULLY REPRODUCIBLE example.


Click to expand!

```javascript

```

_Please remember to remove you google API key from the code you provide here_

Additional context

  • Library Version: [e.g. 1.4.2]
  • React Native Version: [e.g. 0.62.2]

  • [ ] iOS

  • [ ] Android
  • [x ] Web

If you are using expo please indicate here:

  • [x ] I am using expo

Add any other context about the problem here, screenshots etc

Most helpful comment

Thanks @brforest. I am going to update the docs and the snack to remove any reference to cors-anywhere.

All 6 comments

I just double checked this on expo-web. Please make sure your key has billing enabled etc

I just double checked this on expo-web. Please make sure your key has billing enabled etc

billing is enabled, and is working correctly on other platforms, just not web.

Are you using expo-web or some other (react) framework?

Without a reproducible example, it's hard to determine if the issue is a bug in the library vs a bug elsewhere in the code.

Perhaps this could be related - the number of allowed requests on the cors-anywhere.herokuapp.com server went down about a month or two ago, and as of Feb 1 it is no longer an open server:
https://github.com/Rob--W/cors-anywhere/issues/301

Thanks @brforest. I am going to update the docs and the snack to remove any reference to cors-anywhere.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

quandevelopment picture quandevelopment  路  4Comments

sohel-tech picture sohel-tech  路  3Comments

yasirdev picture yasirdev  路  3Comments

frankfaustino picture frankfaustino  路  4Comments

aymkin picture aymkin  路  4Comments