"ReferenceError: google is not defined" @ node_modules/@targomo/googlemaps/targomo-googlemaps.umd.min.js:554
I am currently using React, and I am asynchroniously loading all my third party scripts. However, the above function is self invoking, and that causes issues as I am loading that script with
import tgm from "@targomo/googlemaps" in a component that is loaded only when the google api is loaded. (react-google-maps-loader)
I am fairly new to React, so I am open to the idea that it is up to me to make sure google maps is fully loaded. If I have to wait for google to be fully loaded, then I cannot also at the same time load the extension, which means the loading would potentially take longer.
Hope to hear from you guys soon, take care!
Update: I managed to lazy load the scripts, but it was quite the struggle to get it to load asynchronously. Have a nice day, I hope my current project will bring you a lot of requests! :)
Update 2: Further tests make me believe that loading asynchroniously isn't possible at the moment. So I am defaulting to load the google maps api and the targomo/core api then dynamically loading the google extentions. Also found a CORB warning, see link below.
"ReferenceError: google is not defined" @ node_modules/@targomo/googlemaps/targomo-googlemaps.umd.min.js:554
I am currently using React, and I am asynchroniously loading all my third party scripts. However, the above function is self invoking, and that causes issues as I am loading that script with import tgm from "@targomo/googlemaps" in a component that is loaded only when the google api is loaded. (react-google-maps-loader)
I am fairly new to React, so I am open to the idea that it is up to me to make sure google maps is fully loaded. If I have to wait for google to be fully loaded, then I cannot also at the same time load the extension, which means the loading would potentially take longer.
Hope to hear from you guys soon, take care!
Update: I managed to lazy load the scripts, but it was quite the struggle to get it to load asynchronously. Have a nice day, I hope my current project will bring you a lot of requests! :)
Update 2: Further tests make me believe that loading asynchroniously isn't possible at the moment. So I am defaulting to load the google maps api and the targomo/core api then dynamically loading the google extentions. Also found a CORB warning, see link below.![corb](https://user-images.githubusercontent.com/54803528/65394001-8816d800-dd88-11e9-98a1-ec41a4e2d1a4.PNG)