JS file aggregation causes JS to stop working after Worpdress upgrade
-
Hi,
We recently upgraded from wordpress 5.6 to 5.8.
After the upgrade all JS / Jquery related functionality ceased to function.
Deselecting the “aggregate JS file” option in Autoptimize resolved the issue.But since nothing else changed that doesn’t make sense to me. Inspect / Console displays the following (if the JS files ARE aggregated):
Uncaught TypeError: Cannot read properties of undefined (reading 'apply') at Function.e.<computed> [as unique] (autoptimize_820f524efb7c835466291c97605415d4.js:2) at s.fn.init.add (jquery-1.11.0.min.js?ver=1.1:2) at s.fn.init.addBack (jquery-1.11.0.min.js?ver=1.1:2) at String.<anonymous> (autoptimize_820f524efb7c835466291c97605415d4.js:717) at Function.each (jquery-1.11.0.min.js?ver=1.1:2) at Object.reflow (autoptimize_820f524efb7c835466291c97605415d4.js:717) at s.fn.init.s.fn.foundation (autoptimize_820f524efb7c835466291c97605415d4.js:717) at autoptimize_820f524efb7c835466291c97605415d4.js:719
The error points to a row that deals with jQuery Migrate functionality. I believe WordPress changed / added stuff related to that around ver. 5.5.
function migrateWarnFunc(obj, prop, newFunc, msg) { obj[prop] = function() { migrateWarn(msg); return newFunc.apply(this, arguments); <--- Uncaught TypeError: Cannot read properties of undefined (reading 'apply') } ; }
Any why would Autoptimize cause this when the issue isn’t a factor with aggregation turned off?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘JS file aggregation causes JS to stop working after Worpdress upgrade’ is closed to new replies.