From 38fc721f509a1945b02cbb21cbe37268f5321f9f Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sun, 19 May 2019 23:19:24 +0430 Subject: [PATCH] fix(vue-renderer): safe format ssr logs (#5764) --- packages/vue-renderer/src/renderers/ssr.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/vue-renderer/src/renderers/ssr.js b/packages/vue-renderer/src/renderers/ssr.js index e045b8ecbf..17be19aca2 100644 --- a/packages/vue-renderer/src/renderers/ssr.js +++ b/packages/vue-renderer/src/renderers/ssr.js @@ -1,5 +1,6 @@ import path from 'path' import crypto from 'crypto' +import { format } from 'util' import fs from 'fs-extra' import consola from 'consola' import devalue from '@nuxt/devalue' @@ -42,10 +43,10 @@ export default class SSRRenderer extends BaseRenderer { const logs = [] const devReporter = { log(logObj) { - if (logObj.args[0] instanceof Error) { - logObj.args[0] = logObj.args[0].stack - } - logs.push(logObj) + logs.push({ + ...logObj, + args: logObj.args.map(format) + }) } } consola.addReporter(devReporter)