Uncaught TypeError: undefined is not a function - Using Owl Carousel

Uncaught TypeError: undefined is not a function - Using Owl Carousel

September 15, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Uncaught TypeError: undefined is not a function - Using Owl Carousel

Are you facing the Uncaught TypeError: undefined is not a function error while trying to use Owl Carousel on your Magento site? Don’t worry, I’ve got you covered! In this post, we’ll dive into troubleshooting and resolving this common issue.

The Symptoms

You’ve set up your carousel with the required CSS and JavaScript files:

<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.carousel.css" />
<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.theme.css" />
<link rel="stylesheet" type="text/css" href="js/nwdthemes/owl-carousel/owl.transitions.css" />
<script type="text/javascript" src="js/nwdthemes/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/nwdthemes/owl-carousel/owl.carousel.min.js"></script>

Your HTML markup looks good:

<div id="main-slider" class="owl-carousel mobile-slider">
  <div class="item">{{block type="cms/block" block_id="block_slide1"}}</div>
  <!-- More slides -->
</div>

And you’ve initialized the carousel with your desired settings:

jQuery(document).ready(function(){
  jQuery('#main-slider').owlCarousel({
    singleItem: true,
    slideSpeed: 200,
    stopOnHover: true,
    navigation: true
  });
});

But when you open your browser’s console, you’re greeted with the dreaded Uncaught TypeError: undefined is not a function error.

The Causes and Solutions

1. Missing Dependencies

The most common cause of this issue is missing or incompatible dependencies. Ensure that:

2. Script Loading Order

The order in which scripts are loaded matters. Make sure your scripts are being included correctly:

<script type="text/javascript" src="js/nwdthemes/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/nwdthemes/owl-carousel/owl.carousel.min.js"></script>

The jQuery library should always be loaded before the Owl Carousel script.

3. Incorrect Selector

Ensure that your selector (#main-slider) matches the actual ID of your carousel container.

4. Timing Issues

If you’re using Magento’s default theme, the scripts might not have fully loaded by the time your initialization code runs. Try using a more advanced script loader like RequireJS.

Instead of relying on third-party libraries, consider using Magento’s built-in Magento_Theme/js/view/carousel module. It provides similar functionality and is designed to work seamlessly with the platform.

You can find more information about this in our guide on Implementing a Responsive Image Slider using Magento’s Built-in Carousel.

Conclusion

Resolving the undefined is not a function error usually comes down to ensuring your dependencies are correct, checking your script loading order, and verifying your selectors. If you’re still having trouble, consider switching to Magento’s built-in carousel solution for improved stability.

Remember to always test your changes in a development environment before deploying them to your live site. Happy coding!

Database Performance Themes Configuration

Our network