jquery - Browserify loaded with JqueryUI not working -


i'm having problems using browserify load jquery-ui.

the node modules jquery , jquery-ui loading fine no issues. when try require them bundle using browserify, , load jqueryui datepicker following javascript error in browser:

jquery.deferred exception: $(...).datepicker not function typeerror: $(...).datepicker not function

the app.js contains following:

window.$ = window.jquery = require('jquery'); require('jquery-ui'); 

i'm using gulp , laravel-elixer , package.json contains:

{    "private": true,    "scripts": {      "production": "gulp --production",      "dev": "gulp watch",    },    "dependencies": {      "gulp": "^3.9.1",      "jquery": "^3.1.0",      "jquery-ui": "^1.12.0",      "laravel-elixir": "^5.0.0"    } } 

the gulpfile.js contains:

var elixir = require('laravel-elixir'); elixir(function (mix) {     mix.sass('app.scss');     mix.browserify('app.js');     mix.version(['css/app.css', 'js/app.js']); }); 

is bug or i'm doing wrong? thanks

may using jquery-ui 1.12. browserify incompatible new version. official upgrade page says:

if you're using browserify: umd headers have aren't supported browserify natively, , deamdify plugin has blocking bug. if depend on combination, please fix bug!

https://jqueryui.com/upgrade-guide/1.12/

i haven't tried myself may able make work requiring individual widget

var autocomplete = require( "jquery-ui/ui/widgets/autocomplete" );


Comments