From 3b2ed038da93d2bef8de8848b30d4071091e58cd Mon Sep 17 00:00:00 2001 From: zyxd Date: Wed, 6 Jun 2018 20:52:08 +0400 Subject: [PATCH] fix: wait for core to be ready before listen (#3407) --- lib/core/nuxt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/nuxt.js b/lib/core/nuxt.js index 25f8ac8923..c70bf4485d 100644 --- a/lib/core/nuxt.js +++ b/lib/core/nuxt.js @@ -120,7 +120,7 @@ export default class Nuxt { } listen(port = 3000, host = 'localhost') { - return new Promise((resolve, reject) => { + return this.ready().then(() => new Promise((resolve, reject) => { const server = this.renderer.app.listen( { port, host, exclusive: false }, err => { @@ -155,7 +155,7 @@ export default class Nuxt { // Add server.destroy(cb) method enableDestroy(server) - }) + })) } resolveAlias(_path) {