mhirdes / go_maps_ext

Google Maps Extension for TYPO3
MIT License
21 stars 31 forks source link

Google Maps JavaScript API has been loaded directly without a callback #110

Closed averlon closed 9 months ago

averlon commented 9 months ago

After changing from clickstorm/go_maps_ext to clickstorm/go-maps-ext I get the error message in the Java-Script Console:

Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading

What could be the reason for this? T3: 11.5.33 go-maps-ext: 6.1.0

mhirdes commented 9 months ago

Do you include the Google Maps JavaScript manually?

averlon commented 9 months ago

Do you include the Google Maps JavaScript manually?

No, not that I would be aware of!

With clickstorm/go_maps_ext all worked well. The only thing I changed was to remove it and install clickstorm/go-maps-ext via composer.

averlon commented 9 months ago

any idea?

mhirdes commented 9 months ago

Not really. Please take a look in your code in the frontend. How is the API called. Usually there should be a script tag like this:

<script src="//maps.google.com/maps/api/js?v=weekly&amp;callback=goMapsExtLoaded&amp;key=xxxxxx&amp;language=de" type="text/javascript" async="async"></script>

averlon commented 9 months ago

I have two websites: 1) Production - which still has the old extension included and 2) DEV - with the new extension.

The Production site has this included in the frontend:

<script src="[//maps.google.com/maps/api/js?v=weekly&amp;key=<some key>&amp;language=de](view-source:https://maps.google.com/maps/api/js?v=weekly&key=<some key>&language=de)" type="text/javascript"></script>

Production = www.gwfwsfi.de

DEV is not accessible from the Net

Update: found it at line 5883

<script src="[//maps.google.com/maps/api/js?v=weekly&amp;key=<some key>&amp;language=de](view-source:http://maps.google.com/maps/api/js?v=weekly&key=<some key>&language=de)" type="text/javascript" async="async"></script>

Update 2: I now changed it on the Production site as well: Same effect as on DEV.

Logfile message:

Core: Error handler (FE): PHP Warning: Undefined array key "ff" in /var/www/html/grundw/public/typo3conf/ext/go_maps_ext/Classes/Controller/MapController.php line 246 

Not sure if this has any relevance!

averlon commented 9 months ago

Update: found the error: I deleted my own typoscript and provided the api-key via the plugin.

It looks like, there was an inconsistancy in the constants and setup I used for the "old" extension.


O.K. - let's assume the original error message in the javascript console may lead in the wrong direction.

But even then the google map is not shown.

So what could I do to trace down the problem in some more detail?