Skip to content
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

How to get jScrollPane from node_modules #375

Open
leonziger opened this issue Jun 23, 2020 · 1 comment
Open

How to get jScrollPane from node_modules #375

leonziger opened this issue Jun 23, 2020 · 1 comment

Comments

@leonziger
Copy link

Please advice me how to import jScrollPane from node-modules?

I try to do:

window.$ = window.jQuery = require('jquery');
import '../node_modules/jscrollpane/script/mwheelintent';
import '../node_modules/jscrollpane/script/jquery.mousewheel';
import '../node_modules/jscrollpane/script/jquery.jscrollpane';

$('.my-block').jScrollPane();

I have a mistake:
Uncaught ReferenceError: jQuery is not defined
at Object.6 (mwheelintent.js:76)
at o (_prelude.js:1)
at _prelude.js:1
at Object.8.../node_modules/jscrollpane/script/jquery.jscrollpane (app.js:2)
at o (_prelude.js:1)
at r (_prelude.js:1)
at _prelude.js:1

Thanks for your help

@illuusio
Copy link
Collaborator

illuusio commented Jun 24, 2020

Hello nice question. Problem is that I don't use NPM package I just packit as people seems to like use it but according to internet (https://stackoverflow.com/questions/36509397/node-js-jquery-referenceerror-is-not-defined-error-how-do-i-use-jquery) I assume it should be like:

$ = jQuery = require('jquery')(window);

If it's not I have to eat my own dog food and test this npm package how it works. Can you provide minimal not working code if this ain't the way to fix it for debugging.

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

No branches or pull requests

2 participants