Aggregated javascript contains binary data, breaks site Today I noticed a site's javascript was broken. One of the aggregated javascript files contained a bunch a binary data that (obviously) caused a syntax error;

‹EAk1…ÿŠæ”°!«Ð–¢Á¶]¤µ'³³6â&amp;K2ºÑßÞ,J{3ï½éWgÈzÇAn¤ç#„^)QVãR³ù¬X³ìzåÜaÛ{B¡¶H[#ùóÓ&gt;
Ë


After deactivating the js aggregation the site works fine, and none of the javascript looks off.
Turns out the problem was caused by an external javascript file that had been added through drupal_add_js without specifiying it being external. In my case specifically the pinit module for Pinterest was the culprit.

The external server had recently enabled http gzip compression, so the end result was gzipped data being straight up being concatenated into the js aggregation.