Can’t find variable: jQuery ?
-
Hello,
Your plugin works perfectly but maliciously in the console I still have this error:
ReferenceError: Can’t find variable: jQuery
According to several developers it seems to be due to your plugin?
Do you have any idea?
Thank you in advance,The page I need help with: [log in to see the link]
-
Hi there,
Your server is using mod_pagespeed, therefore although FVM is installed, you still have most JS and CSS files on the HTML. In other words, FVM is there, but it’s not doing anything much, because mod_pagespeed on the server side, is trying to do the same as FVM.
Notice here, how even the files generated by FVM are being overwritten by mod_pagespeed
https://pasteboard.co/HFFroJr.pngHaving said that, your theme seems to have been customized in a way that it tries to use jQuery before it’s actually enqueued on the page.
Here you can see it, the highlighted jQuery call… but before that, a jquery.js should have been included. https://pasteboard.co/HFFsB72.png
I’m guessing you have some other plugin or some code, trying to move javascript to the footer… so this kind of thing will happen.
My suggestion for you… if you are not a developer, disable the mod_pagespeed and stop trying to optimize the site by moving scripts around to the footer.
FVM alone, without pagespeed module and without moving scripts to the footer is much better than mod_pagespeed and other hacks.Alternatively, removing FVM and keeping only mod_pagespeed may work… so don’t try to duplicate things, by using multiple plugins that do the same thing, or by using server and plugins that do the same (they will conflict).
Please hire a developer to help you do speed optimization… or keep it as simple as possible.
Hello,
Thank you very much for the speed of your very detailed answer.
Indeed I tried to optimize the site as much as possible but it is not easy.
The theme I use (Kléo) and the necessary plugins are very heavy.I followed your advice and I just disabled Pagespeed on my server managed by Plesk while keeping FVM.
The apache and nginx cache I still have in place prevents me from seeing the changes (impossible to disable them easily) but I think it should work, you were right.It is very difficult to work with caches when you are not a developer and Google imposes a constant optimization on us…..
Thank you again for the quality of your work!
See you very soon
Sorry but I’m afraid there’s a problem with your plugin.
By following all your instructions the variable refuses to load.
Pagespeed has been deactivated but without success.
On the other hand, when your plugin is deactivated no more problems…..
It seems there’s an incompatibility somewhere………Having the same issue.
Yes, but apart from disabling pagespeed there may be a lot of things going on.
You may have a conflict due to merging JS or css files, so kindly read the faqs on how to use the ignore list: https://ww.wp.xz.cn/plugins/fast-velocity-minify/#faq
Or your theme may have had modifications that do not follow the wordpress api standards.
Things like double minification (ie: your theme is minifying js files, or you have other plugins doing it), or the simple act of merging js files together (even by copy paste), can cause conflicts.
Of course in those situations, disabling FVM will fix it, but again, your files are no longer merged. And the same is true to any other plugin that does the same thing.
Kindly review the faqs on how to use the ignore list, disable pagespeed module and try it again.
You may simply be lacking the skill to configure the plugin properly, so hiring a developer may be the best option.
Alternatively, I suggest using the autoptimize plugin, as it is usually easier to use and sometimes, achieve similar results depending on your site.
If your message is specifically about not finding the variable jQuery, you are probably using the option to defer javascript. That message is telling you, that jQuery is not found because you have deferred it.
You will need to deselect the option to defer javascript on the plugin settings for your site to work. It’s not a plugin issue… but rather a requirement for your theme or plugins (render blocking javascript).
Again, a developer may be the only option to achieve better rankings.
The topic ‘Can’t find variable: jQuery ?’ is closed to new replies.