From 9226f606b57bfc03ab1a3ad951b13025e48683d3 Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Fri, 7 Jul 2017 02:43:35 +0430 Subject: [PATCH] fix(dynamic components): temporary fix for vue-loader 13.0.0 --- lib/app/client.js | 2 ++ lib/app/server.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/app/client.js b/lib/app/client.js index bdf1032952..4f2d18de10 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -180,6 +180,8 @@ async function render (to, from, next) { return Promise.all(promises) .then(() => { Object.keys(_this.components).forEach((name) => { + // Sanetize resolved components (Temporary workaround for vue-loader 13.0.0) + _this.components[name] = _this.components[name].default || _this.components[name] Component.options.components[name] = _this.components[name] }) }) diff --git a/lib/app/server.js b/lib/app/server.js index ee38ab566a..fbddf38aa9 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -159,6 +159,10 @@ export default async (context) => { .then((data) => { // If not dyanmic component, return data directly if (Object.keys(_this.components).length === 0) return data + // Sanetize resolved components (Temporary workaround for vue-loader 13.0.0) + Object.keys(_this.components).forEach(name => { + _this.components[name] = _this.components[name].default || _this.components[name] + }) // Tell renderer that dynamic components has been added context.hasDynamicComponents = true // Add Component on server side (clone of it)