While the browser clearly shows that the new jQuery is loaded and the old one is not, first I noticed that it changes the file from jquery_3_3_1_min.js to jquery_3_3_1_min.min.js . Furthermore, it changes the code inside. For example:
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");
is changed to
!function(b,a){"object"==typeof module&&"object"==typeof module.exports?module.exports=b.document?a(b,!0):function(c){if(!c.document){throw new Error("jQuery requires a window with a document")
And it causes JS to not function due to error - ReferenceError: a is not defined
Is there a way to stop Hubspot from minifying this or some other way to replace the older jQuery libraries to newest ?
Adding jQuery 3 / How to prevent JavaScript automatic minifying
解決
This original post is a couple years old but In-case anyone stumbles onto it I want everyone to know using |replace on standard_header_includes is not the best way to solve this problem.
Regarding minification, we hear ya. Right now we would suggest not minifying files before uploading, preventing files from minifying twice. We're investigating ways that may make it so you can control this but it's not a sure-fire thing and we have no timeline.