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

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:

pastedImage_0.png

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

pastedImage_1.png

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

pastedImage_5.png

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

pastedImage_7.png

and even subsequent hard reloads are valid:

pastedImage_6.png

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 Comments

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

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

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

Level 10 - Community Moderator

Thanks for updatin'.

Honestly I wouldn't even notice if not for the client going "hey, it's yelling at me that I can't overwrite my JSON file again."

Which is to say: if changes like this are going to block uploads, it'd be nice if we could get some notification when this is update.

Level 10 - Community Moderator

Can't believe this is still happening. Who wants to use JS assets as downloadables as opposed to script includes?

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

Community Manager
Status changed to: Open Ideas