From 4151f58fa5c30517a5c83264edadfd03297bc864 Mon Sep 17 00:00:00 2001 From: Eric Gullickson <16152721+ericgullickson@users.noreply.github.com> Date: Tue, 4 Nov 2025 19:33:12 -0600 Subject: [PATCH] Fix Google Maps async loading parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add loading=async query parameter to Google Maps API URL to prevent synchronous DOM manipulation. This fixes the warning: 'Google Maps JavaScript API has been loaded directly without loading=async' The loading=async parameter tells Google Maps to defer API initialization until the script is fully loaded, preventing race conditions with React's DOM management. 🤖 Generated with Claude Code Co-Authored-By: Claude --- frontend/src/features/stations/utils/maps-loader.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/features/stations/utils/maps-loader.ts b/frontend/src/features/stations/utils/maps-loader.ts index e9a1df4..8ce86b1 100644 --- a/frontend/src/features/stations/utils/maps-loader.ts +++ b/frontend/src/features/stations/utils/maps-loader.ts @@ -37,7 +37,7 @@ export function loadGoogleMaps(): Promise { // Create script tag const script = document.createElement('script'); - script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&libraries=places`; + script.src = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&loading=async&libraries=places`; script.async = true; script.defer = true;