From 93c4be2d286787e0d6522fa5bc7f5f437bc9eab5 Mon Sep 17 00:00:00 2001 From: taldy Date: Sun, 26 Mar 2017 17:54:27 +0300 Subject: [PATCH] Support other types of Promises returned by nuxtServerInit() --- lib/app/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/server.js b/lib/app/server.js index fa5cff0c75..f4b2ec16d4 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -81,7 +81,7 @@ export default context => { // nuxtServerInit <% if (store) { %> let promise = (store._actions && store._actions.nuxtServerInit ? store.dispatch('nuxtServerInit', omit(getContext(context), 'redirect', 'error')) : null) - if (!(promise instanceof Promise)) promise = Promise.resolve() + if (!promise || (!(promise instanceof Promise) && (promise && typeof promise.then !== 'function'))) promise = Promise.resolve() <% } else { %> let promise = Promise.resolve() <% } %>