evening clayton;
you should exclude those scripts from being autoptimized, see the FAQ for more info on configuration & troubleshooting.
hope this helps,
frank
Thank you for the help, I read the FAQ, and added the exclude like this wp-content/themes/fmx/build/js/main.min.js, but it still didnt work. Even tried checking the box for try-catch wrapping. Is that not the correct way to exclude it?
it is (although I would just put “js/main.min.js”, but if for example main.min.js depends on jquery, then you’ll also logically have to exclude jquery.min.js (or jquery.js). look at your browser’s error console to see what error(s) are thrown, that should help you troubleshoot.
frank
I have tried every combination I can think of from using full dir name to just js/main.min.js. I excluded jquery-ui.min.js too, and still couldnt get anything to change after save and clear cache. These are the files listed in console with errors –
jquery-ui.min.js?ver=4.1.1:5 Uncaught ReferenceError: jQuery is not defined
main.min.js?ver=4.1.1:1 Uncaught TypeError: Cannot read property ‘fn’ of undefined
bootstrap.min.js?ver=3.3:6 Uncaught Error: Bootstrap’s JavaScript requires jQuery
notes-common-v2.js?ver=3.4.1-201513:158 Uncaught ReferenceError: jQuery is not defined
admin-bar-v2.js?ver=3.4.1-201513:2 Uncaught ReferenceError: _ is not defined
autoptimize_06588244889d1af6479c9e81a1be3801.js:8 Uncaught TypeError: undefined is not a function
Well, “jQuery is not defined” indicates jquery was not excluded (correctly), so that would be my main angle for bugfixing 🙂
I added just
jquery.js
and all the errors went away. When you are logged in there are some console errors related to the admin bar stuff. But that shouldnt be as critical should it? I checked when logged out and there were none, and everything functioned as expected.
great!
regarding admin-bar-stuff; if that doesn’t bother you, you can leave that as is. if it does bother you, “_ is not defined” indicates that underscore is to be excluded 🙂