diff --git a/lib/app/client.js b/lib/app/client.js index fbd3d42cde..0b47a07cdf 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -356,23 +356,15 @@ function nuxtReady (app) { } createApp() -.then((__app) => { +.then(async (__app) => { app = __app.app router = __app.router <%= (store ? 'store = __app.store' : '') %> - return Promise.all(resolveComponents(router)) -}) -.then((Components) => { + const Components = await Promise.all(resolveComponents(router)) const _app = new Vue(app) - - let layout = NUXT.layout || 'default' - return _app.loadLayout(layout) - .then(() => { - _app.setLayout(layout) - return { _app, Components } - }) -}) -.then(({ _app, Components }) => { + const layout = NUXT.layout || 'default' + await _app.loadLayout(layout) + _app.setLayout(layout) const mountApp = () => { _app.$mount('#__nuxt') Vue.nextTick(() => {