You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Console warning: "Google Maps JavaScript API has been loaded directly without loading=async" #232
I tried adding loading=async to googleMapsScriptUrl and the warning disappeared, but then I got this error
usePlacesAutocompleteService.js:110 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'AutocompleteService') at buildService (usePlacesAutocompleteService.js:110:66) at eval (usePlacesAutocompleteService.js:118:16)
I am using usePlacesAutocompleteService but you may try on usePlacesWidget as well.
This solved the issue for me.
I tried this method:
apiKey: `${apiKey}&loading=async`,
but it will cause other errors. 😢
are you trying to display multiple instances of usePlaceService in the same page/component ? because thats the same error I got, I created an issue and the possible workaround, please go through it #236
are you trying to display multiple instances of usePlaceService in the same page/component ? because thats the same error I got, I created an issue and the possible workaround, please go through it #236
Maybe it's different from your situation, I still encounter this issue when only use one AutoComplete component in page.
Then I used the method you provided in #236. Indeed, the previous undefined (reading 'AutocompleteService') issue have been resolved, but the component will encounter another new issue. 😭
are you trying to display multiple instances of usePlaceService in the same page/component ? because thats the same error I got, I created an issue and the possible workaround, please go through it #236
Maybe it's different from your situation, I still encounter this issue when only use one AutoComplete component in page. Then I used the method you provided in #236. Indeed, the previous undefined (reading 'AutocompleteService') issue have been resolved, but the component will encounter another new issue. 😭
sorry for late reply, however I have also noticed the same error in my app but my Autocomplete component works fine so I this isn't bothering me much.
Activity
SamLeatherdale commentedon Mar 9, 2024
The recommendations in Google's docs on Loading the Maps JavaScript API don't even recommend a script tag anymore, they recommend using the @googlemaps/js-api-loader package.
bruno-agileengine commentedon Apr 23, 2024
It seems this issue comes from
googleMapsScriptUrlinsideusePlacesAutocompleteService.tsI tried adding
loading=asynctogoogleMapsScriptUrland the warning disappeared, but then I got this errorusePlacesAutocompleteService.js:110 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'AutocompleteService') at buildService (usePlacesAutocompleteService.js:110:66) at eval (usePlacesAutocompleteService.js:118:16)malikk908 commentedon May 31, 2024
I am using
usePlacesAutocompleteServicebut you may try onusePlacesWidgetas well.This solved the issue for me.
lizhenew commentedon Jun 5, 2024
I tried this method:
but it will cause other errors. 😢

malikk908 commentedon Jun 5, 2024
are you trying to display multiple instances of usePlaceService in the same page/component ? because thats the same error I got, I created an issue and the possible workaround, please go through it #236
lizhenew commentedon Jun 5, 2024
Maybe it's different from your situation, I still encounter this issue when only use one AutoComplete component in page.

Then I used the method you provided in #236. Indeed, the previous
undefined (reading 'AutocompleteService')issue have been resolved, but the component will encounter another new issue. 😭malikk908 commentedon Jul 5, 2024
sorry for late reply, however I have also noticed the same error in my app but my Autocomplete component works fine so I this isn't bothering me much.
nseokaneJHB commentedon May 29, 2025
Used th
This resolved the issue for me