Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

browserify require is broken when jQuery versions mismatch #39

Closed
jeremylevy opened this issue Sep 25, 2015 · 5 comments · Fixed by #40
Closed

browserify require is broken when jQuery versions mismatch #39

jeremylevy opened this issue Sep 25, 2015 · 5 comments · Fixed by #40
Assignees

Comments

@jeremylevy
Copy link

Hello,

Just encountered a problem when requiring hideshowpassword using Browserify.

Given that I need to support IE8, jQuery is defined as ^1.11.3 in my package.json.

Since you have also added jQuery as dependency, and that the two versions mismatch, the hideshowpassword function will be attached to your jQuery instance, instead of mine, making it unavailable from my code.

Why jQuery has been added as production dependency, given that the function is attached to $.fn ?

@jeremylevy jeremylevy changed the title require using browserify is broken when jQuery versions mismatch browserify require is broken when jQuery versions mismatch Sep 26, 2015
@tylersticka tylersticka self-assigned this Sep 28, 2015
@tylersticka
Copy link
Member

I can confirm when using an earlier version of jQuery than what's defined in this module's package.json that two jQuery libraries are bundled. I'll investigate further, I suspect our package.json will need to be updated.

@tylersticka
Copy link
Member

@jeremylevy I have a potential fix pushed to the fix-jquery-dep-ver branch. You can try this locally by removing your current hideshowpassword dependency, and re-installing with the following command:

$ npm install --save cloudfour/hideShowPassword#fix-jquery-dep-ver

You may also need to run npm dedupe. After that, you should no longer see duplicate jQuery modules in the bundle that Browserify generates.

Can you confirm whether or not this resolves the issue? If so, I'll go ahead and merge the branch and push this update to npm.

Thanks for your patience!

@jeremylevy
Copy link
Author

It works! You rock! Thanks 👍

@tylersticka
Copy link
Member

Great! I'll go ahead and merge and bump the version...

@tylersticka
Copy link
Member

@jeremylevy This fix is available in version 2.0.8. I just pushed an update to npm.

Thanks again!

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

Successfully merging a pull request may close this issue.

2 participants