Can't reference a package's functions within my own package


#1

So I’m writing a package that requires meteorflux:reactive-state. This is the relevant part of my package.js file:

Package.onUse(function(api) {
  api.versionsFrom('1.2.1');
  api.use('ecmascript');
  api.use('react');
  api.use('react-meteor-data');
  api.use('meteorflux:dispatcher');
  api.use('meteorflux:reactive-state');
  api.addFiles(['lib/form-state.js', 'SmartForm.jsx', 'SmartInput.jsx']);
  api.export(['SmartForm', 'SmartInput']);
});

When I try to run my app using this package, I get an error:

ReferenceError: ReactiveState is not defined

…from this line:

FormState = new ReactiveState();

Is there something I’m missing? I’ve got the api.use('meteorflux:reactive-state') line in my package.js file.


#2

you mean like ?

var this.FormsState 

I am coffee user so I dont use it but


#3

Sorry, I solved that part - totally edited my entire post :slight_smile:


#4

and you are missing version in your package incliudes
all non-core need them as long as I know


#5

Nope, adding version numbers didn’t fix it.


#6

Hmm, this looks like it should work - perhaps reactive state is only available on the client, and you’re trying to use it on the server?


#8

Oh, duh! That was it. It’s always the simplest, dumbest things, I swear. :laughing: