user3142695
user3142695

Reputation: 17332

Meteor-App: Tracker is not defined

I have a meteor-package like this:

Package.describe({
    name: 'name:anything',
    summary: 'example package',
    version: '0.0.1',
    documentation: "README.md"
});

Package.onUse(function(api){
    api.versionsFrom('[email protected]');

    api.use(['templating', 'mongo']);
    api.use(['iron:[email protected]'], 'client');

    api.addFiles(['lib/client/anything.js'], ['client']);

    api.export('App');

});

In lib/client/anything.js I wrote the lines

App = {};
App.Mode = {};
App.Mode._dep = new Tracker.Dependency();

I added the anything.js file in the package.js and I export the app-var - like you see it above.

But I get the error Uncaught ReferenceError: Tracker is not defined

So what am I doing wrong?

Upvotes: 2

Views: 572

Answers (1)

saimeunt
saimeunt

Reputation: 22696

The tracker package needs to be api.used in your package to be able to reference Tracker.

api.use(['templating', 'mongo', 'tracker']);

Upvotes: 2

Related Questions