Skip to content

sometimes Owl Carousel Slider not working

Now the magento site version is 2.4.3. It’s using the owl carousel for banner image and product images.
And the owl carousel works well. But sometimes it isn’t working.
I think it’s because the owl carousel js loads before the jquery js loaded.
It returns this error. Uncaught TypeError: Cannot read properties of undefined (reading ‘fn’)
at owl.carousel.js:1713:4
at owl.carousel.js:1750:3

I imported the owl carousel js with require js.

var config = {
    paths: {
        'owlcarousel': 'Magento_Theme/js/owl.carousel'
    },
    shim: {
        'owlcarousel': ['jquery']
    }
};

require(['jquery'], function ($) {
    'use strict';

    $.noConflict();
});

Is there anyone can check this? And let me know the solution.

Thanks