electron-log icon indicating copy to clipboard operation
electron-log copied to clipboard

Warning in console: (electron) The remote module is deprecated. Use https://github.com/electron/remote instead.

Open JonathanLydall opened this issue 2 years ago • 4 comments

As at version 4.4.1 the code below from here causes a warning stating (electron) The remote module is deprecated. Use https://github.com/electron/remote instead to appear in the renderer's dev tools console:

if (electron.remote) {
  return electron.remote[name];
}

JonathanLydall avatar Sep 02 '21 08:09 JonathanLydall

Thank you for the report. I'm going to investigate the issue on the next week.

megahertz avatar Sep 02 '21 08:09 megahertz

Unfortunately, that couldn't be fixed quickly. If I have enough time, I'm going to release the next major release in October where that's fixed. Hopefully, it's just a warning and the lib works fine without the remote module.

megahertz avatar Sep 12 '21 13:09 megahertz

Thank you very much for making the time to look into it and reply, it's not urgent from my side, I just wanted to ensure you're aware.

For now it's just a warning, I honestly have no idea which version of Electron might remove it, but I would be surprised if it was soon. In the worst case we could hold off upgrading to the newer Electron for a bit.

JonathanLydall avatar Sep 12 '21 16:09 JonathanLydall

The remote module was finally removed with Electron 14. We can now use @electron/remote as a replacement. Nevertheless. I get a lot of 'call stack exceeded' issue now, probably because log messages are, in some cases, are now sent from main to render and back until node gives up :)

Ah - found it. I mapped the electron-log functions on console and that worked like a charm until electron 13.3 but not with electron 14 (with the latest version of @electron/remote) anymore. This does the 'ping-pong' now.

const _console = {... console};
Object.assign(console, log.functions);
console.warn = log.debug;
console.error = log.debug;

Treverix avatar Sep 17 '21 07:09 Treverix

All remote-related parts are removed from v5

megahertz avatar Nov 24 '22 12:11 megahertz