Opened 3 years ago

Closed 3 years ago

#15015 closed bug (wontfix)

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"

  1. 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
  1. 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

Change History (2)

comment:1 Changed 3 years ago by Jörn Zaefferer

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

comment:2 Changed 3 years ago by Jörn Zaefferer

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.

Note: See TracTickets for help on using tickets.