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

jquery dependency missing from package.json #31

Closed
hauntingEcho opened this issue Aug 23, 2018 · 7 comments
Closed

jquery dependency missing from package.json #31

hauntingEcho opened this issue Aug 23, 2018 · 7 comments

Comments

@hauntingEcho
Copy link

No description provided.

henriqueboaventura pushed a commit that referenced this issue Aug 23, 2018
@henriqueboaventura
Copy link
Owner

Fixed.

@hauntingEcho
Copy link
Author

thanks for responding so quickly! It looks like that commit removed the package.json file entirely though?

henriqueboaventura pushed a commit that referenced this issue Aug 23, 2018
@henriqueboaventura
Copy link
Owner

My bad, it's up and running again ;)

@hauntingEcho
Copy link
Author

thanks!

@d13r
Copy link

d13r commented Oct 23, 2018

I think this should be a peerDependency - otherwise it installs its own local copy of jQuery, which isn't needed and doesn't play nicely with Webpack.

import $ from 'jquery';
import 'imports-loader?jQuery=jquery$!jquery.idle';

$(document).idle({ ... }); // TypeError: (...).idle is not a function

This is because the plugin loads one copy of jQuery (the one npm installed in node_modules/jquery.idle/node_modules/jquery/), while the applications loads a different copy (the one installed in node_modules/jquery/).

Temporary workaround:

import $ from 'jquery';

window.jQuery = $;
require('jquery.idle');
delete window.jQuery;

$(document).idle({ ... });

@henriqueboaventura
Copy link
Owner

Thank you for the suggestion. See the version 1.3.0

@d13r
Copy link

d13r commented Oct 24, 2018

Thanks @kidh0, that works great. 👍

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

3 participants