Skip to content

Commit 14d9b8a

Browse files
fix: no-arg console.log is undefined (electron#22173)
Co-authored-by: Shelley Vohr <codebytere@github.com>
1 parent f0d8729 commit 14d9b8a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/browser/init.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ require('@electron/internal/common/init')
1818
if (process.platform === 'win32') {
1919
// Redirect node's console to use our own implementations, since node can not
2020
// handle console output when running as GUI program.
21-
const consoleLog = (format: any, ...args: any[]) => {
22-
return process.log(util.format(format, ...args) + '\n')
21+
const consoleLog = (...args: any[]) => {
22+
// @ts-ignore this typing is incorrect; 'format' is an optional parameter
23+
// See https://nodejs.org/api/util.html#util_util_format_format_args
24+
return process.log(util.format(...args) + '\n')
2325
}
2426
const streamWrite: NodeJS.WritableStream['write'] = function (chunk: Buffer | string, encoding?: any, callback?: Function) {
2527
if (Buffer.isBuffer(chunk)) {

0 commit comments

Comments
 (0)