Skip to main content
SanfordWhiteman
User Group Leader
User Group Leader
Jul 22, 2016 6:41 AM UTC
New

Fix this bug: .JS files served as application/x-js, so they break in Chrome

A maddening bug: .JS files uploaded to Design Studio are sporadically served with the MIME type x-js.  There's a clue to this when they're uploaded:

Scripts are unusable in Chrome when this occurs (thus meaning scripts can't be hosted reliably on Marketo):

It's notable that it happens directly after a file is uploaded or replaced:

but after a soft reload, it will be served correctly:

and even subsequent hard reloads are valid:

This suggests the problem is cache-related.  But one can't be sure from this end.

Hard-coding the MIME type on the <script> element does not fix the problem.

Scripts should always be served as application/javascript.

8 replies

Casey_Grimes2
Level 10
Dec 9, 2016 4:07 PM UTC

Tacking on a very similar issue here: locally stored JSON files are served as application/octet-stream rather than application/json.

Translate
Casey_Grimes2
Level 10
Dec 22, 2016 2:54 PM UTC

A quick note that JSON files now are correctly serving as application/json as of this morning.

Translate
Casey_Grimes2
Level 10
Jan 11, 2017 4:03 PM UTC

Reverted back to application/octet-stream as of of January 11.

Translate
Chris_Francis
Level 3
Apr 20, 2018 2:29 AM UTC

My javascript files upload as text/plain and also do not work.  How is this not fixed?

Translate
Feb 6, 2020 7:46 PM UTC
No text available
Translate