electron/remote

Error: @electron/remote >= 2.x is required for Electron >= 14

gyteng opened this issue · 3 comments

there is something wrong in initialize function:

if (Number(process.versions.electron.split('.')[0]) >= 14)
    throw new Error('@electron/remote >= 2.x is required for Electron >= 14. See https://github.com/electron/remote/blob/main/docs/migration-2.md for migration instructions.')
  initialized = true

should be:
if (Number(process.versions.electron.split('.')[0]) < 14)

https://github.com/electron/remote/blob/main/src/main/server.ts#L362

weedz commented

The check was added in @electron/remote 1.2.2 since Electron 14 removed enableRemoteModule. I think the remoteMain.enable function should work with earlier versions of Electron so the check could be removed in @electron/remote 2.x?

Either way, @electron/remote 2.x should not throw this error.

The check was added in @electron/remote 1.2.2 since Electron 14 removed enableRemoteModule. I think the remoteMain.enable function should work with earlier versions of Electron so the check could be removed in @electron/remote 2.x?

Either way, @electron/remote 2.x should not throw this error.

I have same issue and electron throws same error while launching the app although I added remoteMain.enable(mainWindow.webContent)

electron version 14
electron/remote version 2

Should be fixed in 2.0.1. Sorry for the disruption!