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

1.3.2.2 contains two jquery versions #6864

Closed
mxab opened this issue Apr 20, 2016 · 7 comments
Closed

1.3.2.2 contains two jquery versions #6864

mxab opened this issue Apr 20, 2016 · 7 comments

Comments

@mxab
Copy link

mxab commented Apr 20, 2016

Hi,

I created a fresh project and added jquery via npm and use it via import jQuery from 'jquery'.

The application has still the packages/jquery.js (1.11.2) but also in the modules.js the npm jquery version

See this basic project sample
https://github.com/mxab/meteor-jquery-issue

screen shot 2016-04-20 at 12 03 36

screen shot 2016-04-20 at 12 03 11

@Ben305
Copy link

Ben305 commented Apr 20, 2016

You have to remove the meteor package for jquery. This is still included in your sample.

@mxab
Copy link
Author

mxab commented Apr 20, 2016

@Ben305 I thought the idea of the 1.3.2 release was that it would then take the jQuery provided by the node modules. Also removing jquery from packages does not show any effect, I assume to some transitive dependency in in some other meteor package.

@abernix
Copy link
Contributor

abernix commented Apr 21, 2016

At the moment blaze-html-templates requires jquery itself. Thus if you continue to use blaze-html-templates (or any other private/public package that uses jquery using the Atmosphere system) this will continue.

With your example, if you remove jquery and blaze-html-templates with meteor remove, you should see the second version go away.

I know there are efforts under way to fix this in Blaze, but don't remember where the ticket is right now (If you want to peek around, Blaze progress is happening over in https://github.com/meteor/blaze now)

@mxab
Copy link
Author

mxab commented Apr 21, 2016

@abernix have you seen this issue #6626 ? As far as I get it the meteor jquery package should detect jquery in the node modules and does not load the built in version, shouldn't it?

@bySabi
Copy link

bySabi commented Apr 21, 2016

You can make the trick creating a local 'jquery' that import already installed jquery module. For example: https://github.com/bySabi/neal-sample-meteor/tree/master/packages/meteor-jquery--module

Remember update version on meteor release updates.

Current version is: 1.11.8

@abernix
Copy link
Contributor

abernix commented Jul 14, 2016

If you install your own version of jQuery with NPM, it should be used. If you don't find this to be the case, please reproduce in the latest version of Meteor and upload a reproduction repo to Github and provide the link.

Thanks!

#7202 (related)

@abernix abernix closed this as completed Jul 14, 2016
@coagmano
Copy link
Contributor

coagmano commented Jul 4, 2017

Even though meteor/jquery does use the npm version when one exists, it still sends it's version to the client in the initial bundle, without using any of the code.

Is there a way to stop meteor from bundling version 1.11.2 to the browser when an npm version exists?

Can dynamic imports help here?

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

5 participants