From f40f3f92c1491166dd9e850694bd53a8ca12894c Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Tue, 5 Feb 2019 09:53:47 +0000 Subject: [PATCH] fix: await buildDone hook (#4955) --- packages/server/src/middleware/nuxt.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/server/src/middleware/nuxt.js b/packages/server/src/middleware/nuxt.js index fe96370d6e..87819a8a99 100644 --- a/packages/server/src/middleware/nuxt.js +++ b/packages/server/src/middleware/nuxt.js @@ -22,7 +22,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux } = result if (redirected) { - nuxt.callHook('render:routeDone', url, result, context) + await nuxt.callHook('render:routeDone', url, result, context) return html } if (error) { @@ -35,7 +35,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux if (fresh(req.headers, { etag })) { res.statusCode = 304 res.end() - nuxt.callHook('render:routeDone', url, result, context) + await nuxt.callHook('render:routeDone', url, result, context) return } res.setHeader('ETag', etag) @@ -74,7 +74,7 @@ export default ({ options, nuxt, renderRoute, resources }) => async function nux res.setHeader('Accept-Ranges', 'none') // #3870 res.setHeader('Content-Length', Buffer.byteLength(html)) res.end(html, 'utf8') - nuxt.callHook('render:routeDone', url, result, context) + await nuxt.callHook('render:routeDone', url, result, context) return html } catch (err) { /* istanbul ignore if */