Dean Radcliffe
Dean Radcliffe

Reputation: 2206

Meteor Package export sometimes missing

I have a package https://github.com/chicagogrooves/meteor-package-kitchen, which, in file client/packageModel.js defines a global:

 packageModel = {...}

And in package.js, we do an api.use of that file, followed by

 api.export("packageModel")

The problem is that the variable packageModel does not appear to be exported correctly. It is not present in the global scope on the client, despite appearing under the key Package["deanius:package-kitchen"].packageModel

To reproduce this, create any old Meteor app, do

 meteor add deanius:package-kitchen

and you will see the same problem, I suspect. This is Meteor 1.1.0.2. I have lost a ton of time on this - I feel like there is some kind of Meteor bug exhibited here - please help!

Upvotes: 0

Views: 251

Answers (1)

prabu
prabu

Reputation: 217

The problem appears to be the debugOnly: true on line 6 in your package.js file. If it's removed, the exported variable is visible. Of course, that doesn't solve your problem, since I'm assuming you want the package to be debug only.

Exported variables don't seem to work for debugOnly packages. Just to be sure, I tried another debug-only package(msavin:mongol) and it's exported variable(Mongol) is not directly visible either.

I think you'll have to file a bug report with the meteor people.

Upvotes: 2

Related Questions