[Venustheme/Sportshop] How can a fix the "TypeError: $.widget is not a function" issue?

Hi Everyone,

I have just installed a theme in magento2.1 and getting

TypeError: $.widget is not a function
$.widget(‘mage.dataPost’, {

TypeError: $.jstree is undefined
$.jstree.themes = require.s.contexts..config.baseUrl + ‘jquery/jstree/themes/’

jstree-mixin.js (line 11, col 9)TypeError: $.ui is undefined
$.ui.timepicker = $.ui.timepicker || {};

i flushed the cache and also deployed the magento after this but nothing seems working for me
Can anyone went through this issue, any solution?

First of all, you should find the name of the third party theme.

Thanks For reply Dmitry,

The theme i am using is Venustheme/sportshop, still stuck, any suggestion ?

When you encounter a problem with a third-party design theme and have learnt its name (the first step) the second your step is to address your question to the theme developer.

1 Like

I fixed the issue by adding

<script type="text/javascript" src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>

Where to add that line?

Defenitely, it is a bug of the VenusTheme design themes.
As a workaround, you can enable the JavaScript files merging, but it is only a workaround, a properly implemented design theme should work without such workarounds.

How to fix «$.widget is not a function»?