Liquid, JavaScript, themes, sales channels
I'm using the Debut theme and have an issue with the hamburger menu button not working. It will work once but when I navigate to a new page nothing happens when I press the button again. When the page loads the following message is shown on the console for theme.js:
TypeError: $.debounce is not a function. (In '$.debounce(50, function() {
styleDropdowns($(selectors.siteNavHasDropdown));
positionFullWidthDropdowns();
})', '$.debounce' is undefined)
If I manually empty caches through the browser and reload the page the error no longer appears in the console and the button works again. However, once I navigate away from the page the issue returns.
Any help would be greatly appreciated.
I'm having this same issue with a Slideshow. Were you able to find a solution?
Hello,
Thank you for your question.
Please share:
- your store URL;
- page URL with the issue you mention;
- storefront password (if your store has one).
I'll help you to the best of my ability.
Kind regards,
Diego
Hi, Have you managed to resolve the issue? I have the same problem. Many thanks.
For anyone coming across this thread:
In most cases, this issue is caused by adding broken code to your theme. You either added a piece of CSS in the wrong place or a piece of Javascript that is throwing up an error and breaking the theme.js, not only the hamburger menu, but all of Javascript functionalities.
In the case of the person who started this thread, for example, they added the $.debounce without properly waiting for jQuery to load, hence breaking all of the website's Javascript.
So, there are a few alternatives to solve this:
1. The simplest way to get around this is, if you added any custom code or app recently, remove them.
2. Download a fresh copy of the Debut theme, copy its theme.liquid, theme.js and theme.css file's content and overwrite them in your theme.
If that doesn't work, either stick with a fresh copy of your theme or hire a Shopify developer and just let them get it fixed for you.
Having your website's Javascript broken is gonna throw your customers off and make you sell less. If you're serious about your business, it's something crucial to get solved ASAP. Such investment will save you time, headache and money.
Kind regards,
Diego
User | RANK |
---|---|
11 | |
11 | |
8 | |
6 | |
6 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022