Optimize
4.5K members online now
4.5K members online now
Everything you need to know about setting up Optimize including creating your account and container, linking to Google Analytics and how to tag your site.
Guide Me
star_border
Reply

Chrome refuse to load script due to "MIME type ('text/html') is not executable"

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

The error in console:

 

Refused to execute script from 'https://optimize.google.com/optimize/inject/inject.js?goptedit=jibberish' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

1 Expert replyverified_user

Chrome refuse to load script due to "MIME type ('text/html') is not executable"

Visitor ✭ ✭ ✭
# 2
Visitor ✭ ✭ ✭

I'm experiencing the same thing here, 58.0.3029.19 (Official Build) beta (64-bit)

Chrome refuse to load script due to "MIME type ('text/html') is not executable"

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Same here, trying to get it setup on a wordpress multisite environment.

Chrome refuse to load script due to "MIME type ('text/html') is not executable"

Google Employee
# 4
Google Employee

Hi

 

Is this problem persistent or did it just happened once? Is it possible that you had logged off your google account?

 

Could you please try the following to troubleshoot:

 

- Make an experiment and try to edit another page like for example: https://www.google.com/analytics/optimize/ to see if that works (you can delete that experiment later).

 

- See if the problem still happens if you use a different network, or a different computer (could you ask someone else to use Optimize and try to edit your page?)

 

- If you are familiar with Chrome dev tools, open the network tab, find the "inject.js" request and have a look at the Response tab.

 

Would be great to have more details about the problem.

Chrome refuse to load script due to "MIME type ('text/html') is not executable"

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

I'm having the same issue on various computers. The console shows this message: 

Refused to execute script from 'https://optimize.google.com/optimize/inject/inject.js?goptedit=<edit>false@false' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

 

I tried installing the script via Tag Manager and directly on the page, with the same result. I changed the server's security settings, that didn't help either.

 

It seems that the mime type of inject.js is set incorrectly, and as a result, the script is not allowed to be executed.

 

Chrome refuse to load script due to &quot;MIME type ('text/html') is not executable&quot;

Google Employee
# 6
Google Employee

Could you please try these 2 things:

 

- Paste directly the script url:

https://optimize.google.com/optimize/inject/inject.js?goptedit=none

on the same tab where you have the problem. Are you getting back a js script?

 

- On Chrome developer tools, click on the network tab, find the inject.js script, click on Headers and see the content-type header. Is it "text/html"?

 

Could this be because of a network proxy, or does it happen on any network?

 

 

Chrome refuse to load script due to &quot;MIME type ('text/html') is not executable&quot;

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi,

I have the same issue.

 

Here my injects.js headers info:

 

Request URL:https://optimize.google.com/optimize/inject/inject.js?goptedit=[DELETED TO NOT SHARE INFO]
Request Method:GET
Status Code:302
Remote Address:216.58.205.206:443


Response Headers
alt-svc:quic=":443"; ma=2592000; v="37,36,35"
cache-controlSmiley Tonguerivate, max-age=0
content-encoding:gzip
content-length:405
content-type:text/html; charset=UTF-8

 

It is clear there is a bug, don't you think?

 

Thank you

 

Chrome refuse to load script due to &quot;MIME type ('text/html') is not executable&quot;

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

Same here: loading the script directly in the browser shows content type text/javascript. But when I put the code snippet in the source, the network tab shows that it's loaded as text/html. I disabled and cleared browser cache.

Chrome refuse to load script due to &quot;MIME type ('text/html') is not executable&quot;

Google Employee
# 9
Google Employee

Hi

 

Thanks for the info. So the 302 status code, indicates that for some reason you are getting redirected.

 

There should also be a line that that looks like

location: ....

 

for example:

 
What is the location URL that you are been redirected to? Is there a possibility that you are somehow logged out of your google account?
 
Also just to confirm: is this something that happened once, or does it happen all the time (i.e. you haven't been able to use the editor)?
 
 

Chrome refuse to load script due to &quot;MIME type ('text/html') is not executable&quot;

Visitor ✭ ✭ ✭
# 10
Visitor ✭ ✭ ✭

Hi, 

 

I am not seeing any redirects. I see this without exception - I've never seen it work.

 

Thanks,

Rick