stripe-meteor icon indicating copy to clipboard operation
stripe-meteor copied to clipboard

TypeError when used with another package

Open davidwoody opened this issue 10 years ago • 5 comments

In the Package.onUse function, I specified both

api.use('mrgalaxy:stripe'); api.imply('mrgalaxy:stripe');

And both have the following error printed to the terminal:

TypeError: Object #<Object> has no method 'require' 
at Package (packages/mrgalaxy:stripe/stripe_server.js:3)

I am not sure what this is stemming from as I am testing in a freshly created app and package.

To reproduce, create a new package and a new app... link the package to the app, and then specify the api.use or imply call with this package name in the newly created package.

I notice this is not an issue when added directly to the app via the standard meteor add mrgalaxy:stripe

davidwoody avatar Sep 05 '14 17:09 davidwoody

Hmm, that's strange, I can't seem to reproduce this error. Truthfully this new package system confused me a lot so I wouldn't be surprised if I'm doing something incorrectly. Think I could see a copy of your package.js file?

tyler-johnson avatar Sep 05 '14 17:09 tyler-johnson

If I include either the api.use or api.imply lines, it throws the error I described above.

package.js file

Package.describe({
  summary: "Subsciptions with Stripe made easy for Meteor",
  version: "0.0.1",
  git: " \* Fill me in! *\ "
});

Package.onUse(function(api) {
  api.versionsFrom('[email protected]');
  // api.use('mrgalaxy:stripe');  
  // api.imply('mrgalaxy:stripe');
  api.addFiles('woody:stripe.js');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('woody:stripe');
  api.addFiles('woody:stripe-tests.js');
});

Any ideas?

davidwoody avatar Sep 06 '14 17:09 davidwoody

@davidwoody Has this been resolved?

tejasmanohar avatar Sep 27 '14 03:09 tejasmanohar

@tejas-manohar I could not figure out what was causing the issue, so I ended up just including the files provided by stripe in my package https://atmospherejs.com/woody/stripe-easy

davidwoody avatar Sep 30 '14 20:09 davidwoody

Any progress here? Anyone else having this issue? This seems like something at the Meteor level but I really have no idea.

tyler-johnson avatar Jan 28 '15 00:01 tyler-johnson