Using Jquery-ui for atom package


#1

We have added jquery-ui package for our feature. So, we added jquery-ui in package.json file. In the code, we have added

require ‘jquery-ui’

But, the functions inside jquery-ui are not accessable. It is throwing error like "Uncaught TypeError: undefined is not a function " We are seeing jquery-ui package downloaded under node_modules.


#2

Looks like you need to load JQuery first according to the instructions?

// load jquery
var $ = require('jquery');

// load everything
require('jquery-ui');

// or load just the modules you need
require('jquery-ui/draggable');
require('jquery-ui/droppable');
require('jquery-ui/sortable');

Edit: Or just listen to @abe … he knows more about these things than me :laughing:


#3

I doubt it’ll work, it seems to me that this module is mostly intended to be used with browserify but I may be wrong.
And if this package is intended to work as a node module then it lacks a main entry in its package.json.