diff --git a/packages/vue-app/template/server.js b/packages/vue-app/template/server.js index 1ed8a8ceaa..983ec92c4c 100644 --- a/packages/vue-app/template/server.js +++ b/packages/vue-app/template/server.js @@ -317,16 +317,16 @@ const render404Page = () => { <% if (features.asyncData) { %> // Call asyncData(context) if (Component.options.asyncData && typeof Component.options.asyncData === 'function') { - const promise = promisify(Component.options.asyncData, app.context) - promise.then((asyncDataResult) => { + const promise = promisify(Component.options.asyncData, app.context) + .then((asyncDataResult) => { ssrContext.asyncData[Component.cid] = asyncDataResult applyAsyncData(Component) return asyncDataResult }) - promises.push(promise) - } else { - promises.push(null) - } + promises.push(promise) + } else { + promises.push(null) + } <% } %> <% if (features.fetch) { %>