jquery.min.js:2 Uncaught TypeError: $j(…).select2 is not a function

When I log in and view the home page, the Testimonial carousel works fine. However, when I view it without logging in, it doesn’t function properly. I’ve observed that an error appears in the console when I access the page without logging in. I’m not sure why carousel not working, Could you please helps us to solve this issue. Here is my URL https://www.absolute-aromas.com/

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js
Uncaught TypeError: $j(...).select2 is not a function
at initSelect2 (woocommerce.min.js:1:108)
at HTMLDocument.<anonymous> (woocommerce.min.js:1:7710)
at e (jquery.min.js:2:27028)
at t (jquery.min.js:2:27330)
</code>
<code>https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js Uncaught TypeError: $j(...).select2 is not a function at initSelect2 (woocommerce.min.js:1:108) at HTMLDocument.<anonymous> (woocommerce.min.js:1:7710) at e (jquery.min.js:2:27028) at t (jquery.min.js:2:27330) </code>
https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js
Uncaught TypeError: $j(...).select2 is not a function
    at initSelect2 (woocommerce.min.js:1:108)
    at HTMLDocument.<anonymous> (woocommerce.min.js:1:7710)
    at e (jquery.min.js:2:27028)
    at t (jquery.min.js:2:27330)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>jQuery.Deferred exception: $j(...).select2 is not a function TypeError: $j(...).select2 is not a function
at initSelect2 (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:108)
at HTMLDocument.<anonymous> (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:7710)
at e (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27028)
at t (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27330) undefined
</code>
<code>jQuery.Deferred exception: $j(...).select2 is not a function TypeError: $j(...).select2 is not a function at initSelect2 (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:108) at HTMLDocument.<anonymous> (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:7710) at e (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27028) at t (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27330) undefined </code>
jQuery.Deferred exception: $j(...).select2 is not a function TypeError: $j(...).select2 is not a function
    at initSelect2 (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:108)
    at HTMLDocument.<anonymous> (https://www.absolute-aromas.com/wp-content/cache/w3-cache/js/13/wp-content/themes/bridge/js/woocommerce.min.js:1:7710)
    at e (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27028)
    at t (https://c0.wp.com/c/6.5.5/wp-includes/js/jquery/jquery.min.js:2:27330) undefined

I tried to disable cache but it’s not working, few days ago it’s working properly.

2

A per what I have checked, you need to convert below:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function initSelect2() {
$j(".woocommerce-ordering .orderby, #calc_shipping_country, #dropdown_product_cat").select2({
minimumResultsForSearch: -1
}),
$j(".woocommerce-account .country_select").select2()
}
</code>
<code>function initSelect2() { $j(".woocommerce-ordering .orderby, #calc_shipping_country, #dropdown_product_cat").select2({ minimumResultsForSearch: -1 }), $j(".woocommerce-account .country_select").select2() } </code>
function initSelect2() {
    $j(".woocommerce-ordering .orderby, #calc_shipping_country, #dropdown_product_cat").select2({
        minimumResultsForSearch: -1
    }),
    $j(".woocommerce-account .country_select").select2()
}

To:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>function initSelect2() {
if($j(".woocommerce-ordering .orderby").length > 0){
$j(".woocommerce-ordering .orderby").select2({
minimumResultsForSearch: -1
});
}
if($j("#calc_shipping_country").length > 0){
$j("#calc_shipping_country").select2({
minimumResultsForSearch: -1
});
}
if($j("#dropdown_product_cat").length > 0){
$j("#dropdown_product_cat").select2({
minimumResultsForSearch: -1
});
}
if($j(".woocommerce-account .country_select").length > 0 ){
$j(".woocommerce-account .country_select").select2()
}
}
</code>
<code>function initSelect2() { if($j(".woocommerce-ordering .orderby").length > 0){ $j(".woocommerce-ordering .orderby").select2({ minimumResultsForSearch: -1 }); } if($j("#calc_shipping_country").length > 0){ $j("#calc_shipping_country").select2({ minimumResultsForSearch: -1 }); } if($j("#dropdown_product_cat").length > 0){ $j("#dropdown_product_cat").select2({ minimumResultsForSearch: -1 }); } if($j(".woocommerce-account .country_select").length > 0 ){ $j(".woocommerce-account .country_select").select2() } } </code>
function initSelect2() {
    if($j(".woocommerce-ordering .orderby").length > 0){
        $j(".woocommerce-ordering .orderby").select2({
            minimumResultsForSearch: -1
        });
    }
    if($j("#calc_shipping_country").length > 0){
        $j("#calc_shipping_country").select2({
            minimumResultsForSearch: -1
        });
    }
    if($j("#dropdown_product_cat").length > 0){
        $j("#dropdown_product_cat").select2({
            minimumResultsForSearch: -1
        });
    }
    if($j(".woocommerce-account .country_select").length > 0 ){
        $j(".woocommerce-account .country_select").select2()
    }
}

What is updated here: First check whether the element is available or not, if yes then only apply select2

5

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật