Open AdamChlan opened 3 weeks 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.
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. 👍
@lindseydiloreto no, we are not doing anything unusual with AJAX or sprig on these templates. Any findings so far?
I don't have a full solution yet, but this might serve as a workaround in the meantime...
Make a copy of googlemaps.js
and dynamicmap.js
, and store them directly in your project.
Disable automatic loading of those assets.
{{ map.tag({'assets': false}) }}
googlemaps.js
and dynamicmap.js
files...<script src="https://maps.googleapis.com/maps/api/js?key={{ googleMaps.browserKey }}" defer></script>
<script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js" defer></script>
<script src="https://yourwebsite.com/path/to/googlemaps.js" defer></script>
<script src="https://yourwebsite.com/path/to/dynamicmap.js" defer></script>
Hopefully that workaround does the trick until I can properly patch it for Craft Cloud support.
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.