doublesecretagency / craft-googlemaps

Google Maps plugin for Craft CMS - Maps in minutes. Powered by the Google Maps API.
https://plugins.doublesecretagency.com/google-maps/
Other
10 stars 10 forks source link

Craft Cloud Compatibility? #121

Open AdamChlan opened 2 weeks ago

AdamChlan commented 2 weeks ago

I'm curious if this plugin is compatible with Craft Cloud. I have a site set up on Craft Cloud, and the plugin works well when running in my local environment, but not on Craft Cloud. I am noticing a couple of the JS files the plugin is trying to call are 404.

Screenshot 2024-10-29 at 1 57 21 PM
lindseydiloreto commented 6 days ago

Great question! I haven't tested with Craft Cloud yet, so I guess we're finding out now that there are some compatibility issues.

Are you doing anything unusual with AJAX or Sprig? If not, take a look at these docs on Required JS Assets to see if there are any helpful workarounds in there. Perhaps you could prevent the automatic loading, and manually load those files instead.

lindseydiloreto commented 6 days ago

I suspect Craft Cloud is having trouble loading the JS files for these two lines...

<script src="https://yourwebsite.com/cpresources/[HASH]/js/googlemaps.js" defer></script>
<script src="https://yourwebsite.com/cpresources/[HASH]/js/dynamicmap.js" defer></script>

I'll dig in and let you know what I find. 👍