diff --git a/src/server/webpack-plugin/client.js b/src/server/webpack-plugin/client.js index ae2a2498672..f889d7b2e01 100644 --- a/src/server/webpack-plugin/client.js +++ b/src/server/webpack-plugin/client.js @@ -19,6 +19,20 @@ export default class VueSSRClientPlugin { const initialFiles = uniq(Object.keys(stats.entrypoints) .map(name => stats.entrypoints[name].assets) .reduce((assets, all) => all.concat(assets), []) + .map(function (file) { + if (typeof file === "string") { + return file; + } + + if ( + Object.prototype.toString.call(file) === "[object Object]" && + file.name + ) { + return file.name; + } + + throw new Error(`file structure is not correct: ${file}`); + }) .filter((file) => isJS(file) || isCSS(file))) const asyncFiles = allFiles diff --git a/src/server/webpack-plugin/server.js b/src/server/webpack-plugin/server.js index 305b4bab58b..ccd68fc86e1 100644 --- a/src/server/webpack-plugin/server.js +++ b/src/server/webpack-plugin/server.js @@ -20,7 +20,21 @@ export default class VueSSRServerPlugin { return cb() } - const entryAssets = entryInfo.assets.filter(isJS) + const entryAssets = entryInfo.assets + .map(function (file) { + if (typeof file === "string") { + return file; + } + + if ( + Object.prototype.toString.call(file) === "[object Object]" && + file.name + ) { + return file.name; + } + + throw new Error(`file structure is not correct: ${file}`); + }).filter(isJS) if (entryAssets.length > 1) { throw new Error(