I received the following error when I first attempted to start Microthemer.
This error was remedied by going into Microthemer Preferences/General and ticking the radio button for “Add “first” and “last” classes to menu items”
Uncaught TypeError: Cannot read property ‘hasClass’ of undefined (line 1)
Microthemer discovered a JavaScript error on your site:
Thanks for information. I was also getting this error. Now with the help of your information, I am able to resolve the issue.
But, is it a Bug and need rectification?
It’s an old setting, from before Microthemer used :first-child and :last-child to target first and last menu items. It’s off by default nowadays. But I’ve kept it for legacy users.
Unfortunately some themes haven’t updated in accordance with changes WordPress has made to the nav_menu_css_class action hook. And so they produce an error when this setting is enabled.
It’s been years since the setting was on by default, so it could be time to retire it…