Infinite loading button on Shopify theme

Today I’ve a problem with a Shopify theme when I try to put on cart an Item. The button is infinite loading.
I’ve an JS error in console and I suspect this come from here:

TypeError: Cannot read property 'classList' of null
    at Product._setCartCountBubble (theme.js?v=14877781539576074710:8609)
    at theme.js?v=14877781539576074710:8434

The line 8609 of the file is:


That’s right, cartCountBubble is empty in Object:

cartCountBubble: null

I don’t know where it could have come from other than here and I can’t put all the code back together to understand….

1 thought on “Infinite loading button on Shopify theme”

  1. I had this issue. It was indeed a mistake I have done in the header…

    <div style="display: none;" id="CartCount" class="site-header__cart-count{% if cart.item_count == 0 %} hide{% endif %} critical-hidden" data-cart-count-bubble>
         <span data-cart-count>{{ cart.item_count }}</span>
         <span class="icon__fallback-text medium-up--hide">
               {{ 'layout.cart.items_count' | t: count: cart.item_count }}

    I used to remove the count bubble of the card icon… it was the origin of my problem


Leave a Comment