Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Maps - Resource interpreted as Script but transferred with MIME type image/png

I did some research and I couldn't find a post that was specific to the Google Maps V3 Javascript API, so I'm posting a new question. Please let me know if there is a more appropriate place for this question.

My Issue:

Without touching anything, my website, utilizing the Google Maps V3 Javascript API, started giving me this error:

Resource interpreted as Script but transferred with MIME type image/png

Refused to execute script from 'http://mt1.googleapis.com/vt?pb=!1m4!1m3!1i15!2i9148!3i11958!1m4!1m3!1i15!2…2m1!1e47!12m3!1e37!2m1!1ssmartmaps!4e3&callback=_xdc_._63mj9u&token=110320' because its MIME type ('image/png') is not executable, and strict MIME type checking is enabled. 

I started getting this in Chrome's javascript console completely out of the blue. Could this be related to too many requests to Google Maps? I was doing some tinkering on the map page and refreshing somewhat frequently, but never touched any of the working script dealing with how the map or its tiles are rendered - so I'm very confused.

Has anyone run into this issue and/or know of a solution?

UPDATE As implied in a comment below, this is not an 'ignorable' issue as it is affecting how the map tiles are rendered. Others are beginning to experience this kind of issue as well, as noted in this post. It is also an issue that is affecting other maps I've initiated on other websites (example).

like image 229
Nikesh Avatar asked Aug 26 '14 07:08

Nikesh


2 Answers

I'm had open a issue in google maps and i got the answer:

There is a problem with the address of this api using htttp protocol. Replace with https that will work.

ex: 'https://maps.googleapis.com/maps/api/js?v=3'

like image 165
Lucas Avatar answered Nov 06 '22 03:11

Lucas


Basically you may assume that it's a bug that has to be fixed in the API, not on clientside.

What you can try and should do:

In production you should always load the release-version of the API.

Currently you try to load the API-version 3.9.2 which isn't available anymore.

Instead the experimental version has been loaded.

Currently the documentation says that 3.17 is experimental and 3.16 is the release-version, but I think this isn't correct(not updated yet).

run inside the console:

alert(window.google.maps.version) 

...and you'll see what has been loaded

As it seems there has been an update, 3.17 is release and 3.18 experimental(I guess the new 3.18 is the source of the issue)

For more info about controlling the version and getting the last stable release see: https://developers.google.com/maps/documentation/javascript/versions

like image 22
Dr.Molle Avatar answered Nov 06 '22 03:11

Dr.Molle