geblanco / electron-router

Router solving Electron hell callback passing, helpfull for MVC
MIT License
123 stars 6 forks source link

Cannot read property 'hasOwnProperty' of undefined" #19

Open tinamore opened 3 years ago

tinamore commented 3 years ago

Hi, thanks for project Today, i have a error :

"Uncaught TypeError: Cannot read property 'hasOwnProperty' of undefined", source: D:\Dropbox\Skyhotel_Int_Apps\electron_tong_dai_tulip123\electron\node_modules\electron-router\router.js (168)

and at line router.js (168)

return remote.hasOwnProperty('getCurrentWindow')

Can you fix this error ?

tinamore commented 3 years ago

Hi, Sorry, i search google and i fixed:

https://stackoverflow.com/questions/37884130/electron-remote-is-undefined

const w = new BrowserWindow({
    webPreferences: {
        enableRemoteModule: true
    }
}); 

The remote module is deprecated. Instead of remote, use ipcRenderer and ipcMain. Can you update your library without remote?

geblanco commented 2 years ago

Hi @tinamore,

Sorry for the delay, I've been out for a while. I understand the issue, but right now is a bit out my scope, do you think you can provide a PR to get it working?

It's been years since I stopped using JS/electron...

Regards,