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

browserify require is broken when jQuery versions mismatch #39

Description

@jeremylevy

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 ?

Activity

  1. changed the title [-]require using browserify is broken when jQuery versions mismatch[/-] [+]browserify require is broken when jQuery versions mismatch[/+] on Sep 26, 2015
  2. self-assigned this
    on Sep 28, 2015
  3. tylersticka commented on Sep 28, 2015

    @tylersticka
    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.

  4. tylersticka commented on Sep 28, 2015

    @tylersticka
    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!

  5. jeremylevy commented on Sep 28, 2015

    @jeremylevy
    Author

    It works! You rock! Thanks 👍

  6. tylersticka commented on Sep 28, 2015

    @tylersticka
    Member

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

  7. tylersticka commented on Sep 28, 2015

    @tylersticka
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions