Plugin Author
NateWr
(@natewr)
Hi Gabriel,
When you inspect the assets loaded in your browser’s dev tools, are you seeing jQuery loaded on the page at all?
Hi Nate,
without AQM active jQuery is being loaded and used. With your plugin active I get this error in the Console: Uncaught Error: Syntax error, unrecognized expression: .asset.handle-sage/css.styles
Plugin Author
NateWr
(@natewr)
Have you brought this issue to the attention of the Sage devs? They’d be better positioned to know why there’s a conflict going on. To be honest, there’s really nothing special about the JavaScript in AQM. It’s pretty basic, unsophisticated jQuery stuff.
I set up a fresh Bedrock/Sage-Wordpress with AQM and “unfortunately” I couldn’t reproduce the error. It works. Where should I dig further? Maybe in my specific Sage code? I already tried to exclude all JS.
Plugin Author
NateWr
(@natewr)
Maybe you’ve got something dequeued without realizing it? With AQM activated, go to the Plugins menu in WordPress. Under AQM you’ll see a link to “Restore Dequeued Assets”.
That should blow away the setting in the database so if there’s anything getting messed with there it should reset.
I’ve done that all the time troubleshooting. I have another idea, I will change the theme and go back in Git history of theming to the point where it failed. Have to test that.
I fixed it!
In the file setup.php the main.css and main.js are being loaded with name ‘sage/css’ and ‘sage/js’. The ‘/’ conflicts with AQM plugin. Simply remove sage from it and there you go. Here are the 2 corrected lines:
wp_enqueue_style('css', Assets\asset_path('styles/main.css'), false, null);
[...]
wp_enqueue_script('js', Assets\asset_path('scripts/main.js'), ['jquery'], null, true);
Plugin Author
NateWr
(@natewr)
Nice! Thanks for reporting back. I’ve filed an issue for this. To be honest, though, I’m not doing much active development on the plugin these days. But at least it’s filed for future reference in case anyone stumbles upon the problem and a solution for AQM.
@gabrielwolf – Thank you and great job, this really helped me. Also, Nate I love this plugin.