Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

contextIsolation is deprecated, but setting it to false throws null error #58

Open
TheColorRed opened this issue Feb 13, 2021 · 1 comment

Comments

@TheColorRed
Copy link

When contextIsolation is set to true, the following error is produced:

TypeError: Cannot read property 'send' of null

However, with it off/emitted, electron says:

(node:9944) electron: The default of contextIsolation is deprecated and will be changing from
false to true in a future release of Electron. See electron/electron#23506 for more information

  const win = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: true
    }
  })

Is there a way around this?

@Nantris
Copy link

Nantris commented Feb 16, 2021

You can't use nodeIntegration with contextIsolation - they're mutually exclusive.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants