Load GoogleMaps async then add package

Hi
I’m trying to add GoogleMaps and SnazzyInfoWindow in Sage9.

I added SnazzyInfoWindow with yarn add and import in main.js
import 'snazzy-info-window/dist/snazzy-info-window.min.js';

in mypage.js I added GoogleMaps like this:

 function loadScript(src) {
      return new Promise(resolve => {
        const script = document.createElement('script');
        script.src = src;
        script.type = 'text/javascript';
        script.async = true;
        script.onload = resolve;
        document.body.appendChild(script);
      });
    }
    // Load 3rd Party SDK and initialize
    loadScript('https://maps.googleapis.com/maps/api/js?key=XXX').then(() => {
       console.log('maps loaded'); 
      initMap();
    });

The problem is, that SnazzyInfoWindow has to be loaded AFTER GoogleMaps to work, so I tried to add the package like this in the initMap() function:

const SnazzyInfoWindow = require('snazzy-info-window');

But it doesn’t work.
Basically my question is, how do I properly add/import the package after GoogleMaps has loaded?

Thanks very much!

ok just found the solution. Had to remove the import from main.js