tyler-johnson / stripe-meteor

A Meteor package containing Stripe.js, Node-Stripe, and Stripe Checkout.
https://atmospherejs.com/mrgalaxy/stripe
150 stars 44 forks source link

TypeError when used with another package #18

Open davidwoody opened 10 years ago

davidwoody commented 10 years ago

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

tyler-johnson commented 10 years ago

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?

davidwoody commented 10 years ago

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('METEOR@0.9.1');
  // 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?

tejasmanohar commented 10 years ago

@davidwoody Has this been resolved?

davidwoody commented 9 years ago

@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

tyler-johnson commented 9 years ago

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