Fix this bug: .JS files served as application/x-js, so they break in Chrome | Community
Skip to main content
SanfordWhiteman
Level 10
July 22, 2016
New

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

  • July 22, 2016
  • 3 replies
  • 3645 views

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.

3 replies

Casey_Grimes2
Level 10
December 9, 2016

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

Casey_Grimes2
Level 10
December 22, 2016

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

Casey_Grimes2
Level 10
January 11, 2017

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

Chris_Francis
Level 3
April 20, 2018

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

February 6, 2020
No text available