Skip to main content

Search and Top Navigation

#15015 closed bug (wontfix)

Opened July 23, 2016 04:55AM UTC

Closed July 25, 2016 12:35PM UTC

jquery-ui + browserify not work

Reported by: alexey2baranov Owned by:
Priority: minor Milestone: none
Component: ui.core Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:
Description

jQuery 3.1.0 and jQuery UI 1.12.0 with browserify not work/ Hire is step by step instruction and github test project

1. install jquery and jquery ui

npm install --save jquery jquery-ui

in time this report written npm insalled "jquery": "3.1.0", "jquery-ui": "1.12.0"

2. created simple test script

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


$(function(){
   $('#qwerty').draggable();
});

3.compile them with browserify

browserify --debug index.js -o dist/index.js

4. loaded browserify result into test html page

<head>
    <script src="dist/index.js"></script>
</head>
<body>

<div id="qwerty" style="position: absolute; width: 100px;  height: 100px; background-color: #0b3e6f">123</div>
</body>

finally we should get draggable div. But insted got this error in chrome console

''jQuery.Deferred exception: $(...).draggable is not a function TypeError: $(...).draggable is not a function at HTMLDocument. undefined index.js [sm]:10Uncaught TypeError: $(...).draggable is not a function''

any other jquery UI widget get the same error so this is not just draggable error.

i create simple test app as written above to demonstrate my problem

https://github.com/alexey2baranov/jquery-ui-broken-demo

Attachments (0)
Change History (2)

Changed July 23, 2016 03:37PM UTC by jzaefferer comment:1

This is a problem with browserify (it works fine with webpack: https://github.com/jzaefferer/webpack-jquery-ui ). For browserify, you need to use the deamdify plugin, but that is buggy: https://github.com/jaredhanson/deamdify/issues/33 There's a recent PR for that issue, might be worth testing or helping to finish that: https://github.com/jaredhanson/deamdify/pull/39

Changed July 25, 2016 12:35PM UTC by jzaefferer comment:2

resolution: → wontfix
status: newclosed

Since this is a browserify/deamdify issue, I'm closing this. We've got https://github.com/jquery/jqueryui.com/issues/150 for documenting the issue and how to solve it with webpack.