Error while extending jQuery widget

I’m trying to extend the widget in vendor/amasty/label/view/base/web/js/label.js and override a functionality in one of its methods. The error I get is:

TypeError: base is not a constructor in jquery-ui.js


These are my customizations:

  • app/code/Vendor/Module/view/base/requirejs-config.js
var config = {     map: {         '*': {             'Amasty_Label/js/label': 'Vendor_Module/js/label-extend'         }     } }; 
  • app/code/Vendor/Module/view/base/web/js/label-extend.js
define([     "jquery",     "jquery/ui",     "Amasty_Label/js/label" ], function ($  ) {     $  .widget('vendor.amShowLabel', $  .mage.amShowLabel, {          _init: function () {             this._super();         },          setLabelStyle: function() {...}     });      return $  .vendor.amShowLabel; }); 

Any idea how to solve this?