Skip to content

Instantly share code, notes, and snippets.

@c0d0g3n
Last active December 2, 2016 17:21
Show Gist options
  • Save c0d0g3n/acef9273422dbea2f81f0d2b610c9709 to your computer and use it in GitHub Desktop.
Save c0d0g3n/acef9273422dbea2f81f0d2b610c9709 to your computer and use it in GitHub Desktop.
ghostServer.restart() error
var path = require('path'),
config;
config = {
// development environment
development: {
url: 'http://localhost:2368',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, 'node_modules', 'ghost', 'content', 'data', 'ghost-dev.db')
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2368'
},
paths: {
contentPath: path.join(__dirname, 'node_modules', 'ghost', 'content')
}
}
};
module.exports = config;
var gulp = require('gulp');
var ghost = require('ghost');
var path = require('path');
gulp.task('test', function (callback) {
ghost({
config: path.join(__dirname, 'ghost-dev-config.js')
})
.then(function (ghostServer) {
ghostServer.start();
// Restart Ghost after a few seconds to reproduce the bug
setTimeout(function() {
// This rule throws the error
ghostServer.restart();
// // However, this does work...
// ghostServer.stop();
// ghostServer.start();
}, 1000);
});
callback();
});
gulp test
[17:45:21] Using gulpfile ~/Bureaublad/dev/crosshair/http/gulpfile.js
[17:45:21] Starting 'test'...
[17:45:21] Finished 'test' after 7.07 ms
Ghost is running in development...
Listening on 127.0.0.1:2368
Url configured as: http://localhost:2368
Ctrl+C to shut down
Ghost is closing connections
Unhandled rejection TypeError: rootApp.listen is not a function
at /home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/core/server/ghost-server.js:55:39
at Promise._execute (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/debuggability.js:299:9)
at Promise._resolveFromExecutor (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:481:18)
at new Promise (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:77:14)
at GhostServer.start (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/core/server/ghost-server.js:40:12)
at tryCatcher (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/async.js:148:10)
at Immediate.Async.drainQueues (/home/bruno/Bureaublad/dev/crosshair/http/node_modules/ghost/node_modules/bluebird/js/release/async.js:17:14)
at runCallback (timers.js:637:20)
at tryOnImmediate (timers.js:610:5)
at processImmediate [as _immediateCallback] (timers.js:582:5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment