Ghost-App: this.ghost is undefined

Hello guys,

Trying to build a testing app to figure out how it’s working reading the wiki I got one important error:

TypeError: Cannot read property 'api' of undefined

My app is under content/apps/ghost-tonnyorg, and inside I’ve 2 files: package.json and index.js

This is my package.json:

{
    "name": "ghost-tonnyorg",
    "version": "0.1.0-beta.1",
    "dependencies": {
        "ghost-app": "0.0.2"
    }
}

And this is my index.js:

var App = require('ghost-app'),
    TonnyORG;

TonnyORG = App.extend({
    install: function () {},
    uninstall: function () {},
    activate: function () {
        console.log('MyApp: activate()');
        console.log(this.ghost.api);
    },
    deactivate: function () {}
});

module.exports = TonnyORG;

Am I missing something here?

Thank you all!

NVM I figured out digging in the code, this.app was changed to this.ghost in the latest commit of Ghost-App, however the tag 0.0.2 was not moved to the latest commit so whenever we pull ghost-app 0.0.2 that change is not reflected.

I’m going to send a PR to fix it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.