DeprecationWarning with Electron 8.0.0
See original GitHub issueHi,
a deprecation warning is being shown when electron-log is used with Electron 8.0.0 and
webPreferences: { nodeIntegration: true }
is set.
(node:69267) DeprecationWarning: Passing functions, DOM objects and other non-cloneable JavaScript objects to IPC methods is deprecated and will throw an exception beginning with Electron 9.
The problem seems to be these 2 lines https://github.com/megahertz/electron-log/blob/master/src/transports/ipc.js#L28 https://github.com/megahertz/electron-log/blob/master/src/electronApi.js#L123 related to this change https://github.com/electron/electron/pull/20214
Steps to reproduce
node@12.14.1
electron@8.0.0
electron-log@4.0.5
$ npx electron ./tests/test.js
08:40:02.497 › App ready!
(node:69513) DeprecationWarning: Passing functions, DOM objects and other non-cloneable JavaScript objects to IPC methods is deprecated and will throw an exception beginning with Electron 9.
(node:69513) DeprecationWarning: Passing functions, DOM objects and other non-cloneable JavaScript objects to IPC methods is deprecated and will throw an exception beginning with Electron 9.
test.js
const path = require('path')
const electron = require('electron')
const { app, BrowserWindow } = electron
const logger = require('electron-log')
app.allowRendererProcessReuse = true
app.once('ready', () => {
logger.info('App ready!')
const win = new BrowserWindow({
webPreferences: {
nodeIntegration: true
}
})
win.loadURL(`file://${path.resolve(__dirname, 'index.html')}`)
})
index.html
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Test</title>
</head>
<body>
<h1>Hello</h1>
</body>
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Electron 8.0.0
Electron 8.0.0 has been released! It includes upgrades to Chromium 80 ... Show module name in deprecation warning for context-aware modules.
Read more >Warning message "DeprecationWarning: Invalid 'main' field in ...
This warning message will only show on Node 16. You can safely ignore the warning, but to get rid of it you can...
Read more >Deprecated APIs | Node.js v19.3.0 Documentation
Deprecated APIs#. Node.js APIs might be deprecated for any of the following reasons: Use of the API is unsafe. An improved alternative API...
Read more >electron-mocha/CHANGELOG.md - UNPKG
The CDN for electron-mocha. ... 93, 8.0.0 / 2019-04-08. 94, ------------------ ... "Squash deprecation warning for electron 0.35.0".
Read more >Changelog - Cypress Documentation
Fixed a regression introduced in the Electron browser in Cypress 10.8.0 where the ... Fixed a regression in 8.0.0 where Cypress would always...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the example @raphinesse, I’ll try to fix that on this week.
Thanks for your quick fix. Works great for me! 🏅