From 5e7c59469156ba68f2e161a81dda372c5d5ec429 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Wed, 12 Feb 2020 17:25:11 +0000 Subject: [PATCH] fix: no-arg console.log is undefined (#22165) --- lib/browser/init.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/browser/init.ts b/lib/browser/init.ts index b23677be3..958ec3a16 100644 --- a/lib/browser/init.ts +++ b/lib/browser/init.ts @@ -18,8 +18,10 @@ require('@electron/internal/common/init') if (process.platform === 'win32') { // Redirect node's console to use our own implementations, since node can not // handle console output when running as GUI program. - const consoleLog = (format: any, ...args: any[]) => { - return process.log(util.format(format, ...args) + '\n') + const consoleLog = (...args: any[]) => { + // @ts-ignore this typing is incorrect; 'format' is an optional parameter + // See https://nodejs.org/api/util.html#util_util_format_format_args + return process.log(util.format(...args) + '\n') } const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) { if (Buffer.isBuffer(chunk)) {