meteorhacks / npm

Complete NPM integration for Meteor
http://meteorhacks.com/complete-npm-integration-for-meteor.html
MIT License
508 stars 43 forks source link

Deprecation error with Meteor 1.2-rc.11 #95

Open ghost opened 9 years ago

ghost commented 9 years ago

Trying to upgrade from rc10 to rc11 results in the following error:

[[[[[ app ]]]]]

=> Started proxy.                             
=> Errors prevented startup:                  

   While reading package from `...../app/packages/npm-container`:
   package.js:23:7: The `isAsset` option to `addFiles` is deprecated. Use PackageAPI#addAssets instead.

=> Your application has errors. Waiting for file change.
=> Started MongoDB.  
jasonxeno commented 9 years ago

Getting the same error.

adam-r-kowalski commented 9 years ago

There is an easy fix, you just need to update the call like described in the error.

// packages/npm-container/package.js - OLD VERSION
Package.onUse(function(api) {
  api.add_files('index.js', 'server');
  api.add_files('../../packages.json', 'server', {
    isAsset: true
  });
});
// packages/npm-container/package.js - NEW VERSION
Package.onUse(function(api) {
  api.add_files('index.js', 'server');
  api.addAssets('../../packages.json', 'server');
});
arunoda commented 9 years ago

I published a updated version for this. Simply updating meteorhacks:npm won't work here. Need to follow these steps.

rm -rf packages/npm-container
meteor remove npm-container
meteor update meteorhacks:npm
meteor

Basically, it removes the npm-container and then update meteorhacks:npm

stubailo commented 9 years ago

Oops! Didn't realize this would break things. Sorry about that.

arunoda commented 9 years ago

That's fine. Anyway, we have to update it :)

lorensr commented 8 years ago

Those steps fit it for me, thanks!

derwaldgeist commented 8 years ago

Stumbled upon this issue. I think the Meteor upgrade guide should be updated. In this guide, it says: Package authors must make this change to their package.js files before they can publish from Meteor 1.2, but existing published packages will continue to work. Obviously, this is not the case for all packages.

jacobdr commented 8 years ago

+1 for resolution provided by @arunoda

bmustata commented 8 years ago

+1

stubailo commented 8 years ago

This shouldn't be the case in meteor 1.2.1 anymore.

bmustata commented 8 years ago

It's working in meteor 1.2.1.