Skip to content

Problem with npm install and jquery-ui #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Kinnza opened this issue Sep 5, 2016 · 12 comments
Closed

Problem with npm install and jquery-ui #524

Kinnza opened this issue Sep 5, 2016 · 12 comments

Comments

@Kinnza
Copy link

Kinnza commented Sep 5, 2016

Im using the latest version 2.6, with the required jquery-ui (1.12)

if i use require/import for gridstack i get errors loading jquery-ui components. for example:
Module not found: Error: Cannot resolve module 'jquery-ui/version' in /develop/gigaspaces/cloudify-ui-new/node_modules/gridstack/dist

I see in jquery-ui documentation that in 1.12 they moved the files to a nested ui directory, so the require should be like so: jquery-ui/ui/version.

I also see in gridstack code the loading of the wrong modules:
define(['jquery', 'lodash', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable',
'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7',
'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent',
'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget',
'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable',
'jquery-ui/widgets/resizable'], factory);

@radiolips
Copy link
Member

#513

@Kinnza
Copy link
Author

Kinnza commented Sep 6, 2016

Thanks!
Found the webpack solution:

resolve: {
    alias: {
        'jquery-ui': 'jquery-ui/ui'
    }
},

@jeffochoa
Copy link

@Kinnza nice, I was having the same issue.

@nerdess
Copy link

nerdess commented Mar 20, 2017

@Kinnza i've added your snippet to node_modules/react-gridstack/webpack.config.js but it does not fix the same issue i have. is this the wrong place?

(edit: i fixed the issue by changing the paths inside gridstack.js to e.g. '../../jquery-ui/ui/data.js' but your solution would be cleaner)

@sambegin
Copy link

sambegin commented Mar 21, 2017

@nerdess

It's not in react-gridstack's webpack.config.js you need to add this config but in your own webpack.config.js file.

Example, we're taking gridstacks AND jquery-ui from node_modules.

So in our webpack.config.js file we have :

resolve: {
        alias: {
            'jquery-ui': path.resolve(__dirname, 'node_modules/jquery-ui/ui')
        }
    },

Then "import "gridstack/dist/gridstack";" (from node_module) should find jquery-ui.

Note: we're using webpack v.2 and you should never edit node_modules files ;)

AshMartian added a commit to AshMartian/ember-gridstack that referenced this issue Jul 8, 2017
Beginning in 1.12 jQuery UI has a new subfolder for widgets. See: gridstack/gridstack.js#524
@vgupta91
Copy link

i don't manage webpack in my project but i got this error

@adumesny
Copy link
Member

@vgupta91 what version of gridstack are you using ? in 1.x we bundle jquery-ui as part of gridstack.all.js so you don't want to include it yourself. See the readme about it.

@vgupta91
Copy link

"react-gridstack": "^0.1.4",
"jquery-ui": "^1.12.1"

@vgupta91
Copy link

"gridstack": "^1.1.0"

@adumesny
Copy link
Member

adumesny commented Mar 12, 2020

@vgupta91 this is a separate issue - react-gridstack hasn't been updated in a long time and list

    "gridstack": "^0.2.5",
    "jquery": "^2.2.1",
    "lodash": "^4.11.1"
  }

so you might be able to use an older gridstack version like 0.5.5, but you will have to ping them about updating to a later/latest. Right now it list 0.2.5

@Bennajachin-Hexaware
Copy link

I am getting this error. Can't resolve 'jquery-ui/data And i am using react i tried adding webpack.js. Still i am getting same error.

@adumesny
Copy link
Member

@Bennajachin-Hexaware are you using the no longer maintained react-gridstack or gridstack directly ? as I mentioned above jquery-ui (minimal version) is now bundled in 1.x gridstack-all.js and there is a readme section about it.
You didn't say what you're using... hard to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants