Issue with Meteor update - package related

Hi All,

I’m trying to get the steps proper so can replicate issue, but it is a bit messy. This is the problem.

(1) Have main app which has package aldeed:simple-schema and aldeed:collection2
(2) Have a package which uses aldeed:simple-schema and aldeed:collection2, but also uses aldeed:autoform.
(3) In the package.js, have line…

api.use([‘aldeed:simple-schema’, ‘aldeed:collection2’, ‘aldeed:autoform’], [‘client’, ‘server’]);

The problem was - When i do this, meteor rebuilds the application but uses autoform version 0.16.0. It also refuses to update despite several add/remove/update aldeed:autoform@5.8.1 attempts. Meteor was quite helpful here as it pointed out the 0.16.0 was incompatible with Meteor 0.9 onwards.

I finally got it to work by -
a. removing autoform using meteor remove.
b. edited .meteor/versions to remove the version information.
c. remove aldeed: autoform from the package.
d. did clean install on the base application of autoform.
e. then add the autoform into the package.

Finally - my question - should all packages used in my app, even if only in a sub package, be explicitly added into the top level application, or is meteor add/remove dodgy with sub package dependencies?

TL;DR - if declaring a new package in api.use in sub package, the wrong version of package gets installed. Am i doing this wrong?

You always need to specify the versions of your package dependencies.
The only exception where you can leave out the version of your package dependencies is, when your package is app specific and you have added the package dependency also directly to your app. In this case you can change the package dependency version via .meteor/versions file. You can update the dependency via meteor update <my-dependency>.

Hi Sanjo,

Thank you for the comment. If i can please clarify?

What you are saying is that in api.use in package.js in my own packages should have versioning information on all of them?

So if I’m using the templating package and the flow router package, i should version all of them (unless the package has been previously added directly to my base application?)

Thanks so much.

Tat

Yes. You don’t need to specify the version of Meteor core packages. Meteor will automatically use the right version based on the Meteor release that you use. For reusable Meteor packages you specify the Meteor release version with http://docs.meteor.com/#/full/pack_versions.

Ok - will do that going forward. Do not want to have to include everything in the base app, hence needed the clarification.

Much appreciate you taking the time to clarify. Thanks so much.

Tat