-
Notifications
You must be signed in to change notification settings - Fork 117
Console warning: "Google Maps JavaScript API has been loaded directly without loading=async" #232
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
Comments
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. |
It seems this issue comes from export default function usePlacesAutocompleteService({
apiKey,
libraries = "places",
googleMapsScriptBaseUrl = GOOGLE_MAP_SCRIPT_BASE_URL,
debounce = 300,
options = {},
sessionToken,
language,
}) {
const languageQueryParam = language ? `&language=${language}` : "";
const googleMapsScriptUrl = `${googleMapsScriptBaseUrl}?key=${apiKey}&libraries=${libraries}${languageQueryParam}`; I tried adding
|
I am using This solved the issue for me. |
I tried this method:
|
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. |
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. |
When using usePlacesWidget hook, a warning is shown in the console:
Is it possible to add async attribute to script during loadGoogleMapScript execution?
The text was updated successfully, but these errors were encountered: