question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work with Electron 14

See original GitHub issue

Current version (4.0.2) of Electron-settings doesn’t work with new version Electron. I use Electron v14.1.1 I got a error in render process:

screenshot_2021-10-11T21:07:18

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
jediwadecommented, Nov 27, 2021

@ChugunovRoman I am assuming you are trying to use electron-settings in the Renderer (you should provide more information in your bug reports). If you want to use the newer versions of Electron and have access to higher level APIs like remote, you need to make use of the context isolation feature to create a limited API that can be called from the Renderer. You shouldn’t try to get around the security changes Electron has implemented. Yes the context isolation is a pain, but it is in the app user’s best interest of your app.

1reaction
caowenjin2commented, Oct 27, 2021
Snipaste_2021-10-27_14-53-28

You can fix it temporarily by provide a custom Electron instance;

const getElectron = () => {
    const electron = window.require('electron');
    // @ts-ignore
    electron.remote = electron.remote || window.require('@electron/remote');
    return electron;
}
const settings = window.require('electron-settings');
settings.configure({
     electron: getElectron(),
 })
Read more comments on GitHub >

github_iconTop Results From Across the Web

Electron 14.0.0
Electron 14.0.0 has been released! It includes upgrades to Chromium 93 and V8 9.3. We've added several API updates, bug fixes, and general ......
Read more >
[BUG] Electron 14+ does not work with @nestjs/common #15983
Yes it does support Electron 18. Could you provide us a minimal reproducible what exactly is not working so we can run it...
Read more >
How to upgrade to Electron 14+ - Stack Overflow
P.S. : I don't know a thing about JS/TS. I only have some limited experience with C++. I just want Caprine to work...
Read more >
electron-packager - npm
This module requires Node.js 10.0 or higher to run. npm install --save-dev electron-packager. It is not recommended to install ...
Read more >
How to build an Electron app using create-react-app ... - Medium
import electron from 'electron';. There is some discussion about this error in various GitHub and Stack Overflow issues, such as this one. Most...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found