You’ll have to make sure jQuery is not asynced/ deferred seniordeemos. Can you do so and then re-test?
this happens when i start enabling async javascript plugin, when i turn off the async javascript plugin everything works fine , but the website speed is too slow.
How can i make jquery not to defer or async,
Settings -> Async JavaScript -> Settings -> jQuery -> make sure it is set to “exclude”

For you to have a better understanding what is going on.
Autoptimize Plugin is Activated with this settings:
javascript.
Optimize JavaScript Code? Checked
Do not aggregate but defer? Checked
Also defer inline JS? Checked
CSS
Optimize CSS Code? Checked
all other options unchecked
Misc Options
All options are checked.
Then once i try to enable Async javascript plugin and check on enable async javascript. i got these error
i checked that jquery is not defered or asynced i checked on excluded , but still getting these errors ,
autoptimize_single_1e1f6bda57b3fe634f02092ec0f871e0.js?ver=2.6.3:1 Uncaught TypeError: Cannot read properties of undefined (reading 'hooks')
at Function.<anonymous> (autoptimize_single_1e1f6bda57b3fe634f02092ec0f871e0.js?ver=2.6.3:1:1637)
at Function.each (jquery.min.js?ver=3.6.0:2:3053)
at init (autoptimize_single_1e1f6bda57b3fe634f02092ec0f871e0.js?ver=2.6.3:1:1613)
at dispatch (jquery.min.js?ver=3.6.0:2:43064)
at v.handle (jquery.min.js?ver=3.6.0:2:41048)
at Events.dispatch (frontend.min.js?ver=3.6.8:2:34540)
at Frontend.init (frontend.min.js?ver=3.6.8:2:8664)
at HTMLDocument.<anonymous> (frontend.min.js?ver=3.6.8:2:8999)
at e (jquery.min.js?ver=3.6.0:2:30038)
at t (jquery.min.js?ver=3.6.0:2:30340)
Uncaught ReferenceError: _ is not defined
at wp-util.min.js?ver=6.0.1:2:110
at wp-util.min.js?ver=6.0.1:2:1297
(anonymous) @ wp-util.min.js?ver=6.0.1:2
(anonymous) @ wp-util.min.js?ver=6.0.1:2
Thta’s the website if you wanna take a look https://lavracaccidentlaw.com/
OK, can you try adding wp-includes/js to the AsyncJS exclusion list?
i added this wp-includes/js to Async Javascript plugin under “Script Exclusion” but still the same problem
i found the problem is that when i tried to defer the whole javascript everything worked fine
i added this wp-includes/js to Async Javascript plugin under “Script Exclusion” but still the same problem
what JS error do you see on the browser console in that case?
no JS Errors , it is all Errors like
`Uncaught ReferenceError: _ is not defined
at wp-util.min.js?ver=6.0.1:2:110
at wp-util.min.js?ver=6.0.1:2:1297
(anonymous) @ wp-util.min.js?ver=6.0.1:2
(anonymous) @ wp-util.min.js?ver=6.0.1:2`
Uncaught ReferenceError: _ is not defined
well, that’s a JS error actually 🙂
but what is surprising; _ (underscore) is inside wp-includes/js, so it should be defined if wp-includes/js is excludes from being asynced.
i found the problem is that when i tried to defer the whole javascript everything worked fine
you mean switching AsyncJS configuration from async to defer? that would indeed be the better setting.
So one last question , when this will take effect on GTmetrics Analysis ?
If you’re on some plan that does continuous/ regular performance tests then I’m afraid i don’t know, but if you’re referring to standard GTmetrics one-off tests it should show immediately (assuming you cleared and re-popuplated your page cache).