DEV Community

Discussion on: Bundling TypeScript + React Electron Apps with Parcel

Collapse
 
ashwanth1109 profile image
Ashwanth A R

Hi Dennis,

Thanks for the article! I found it pretty helpful.

Wanted to let you know that if I use "window.require" in my react app, it throws an error. You need to enable nodeIntegration in "electron.js" file as follows:

mainWindow = new BrowserWindow({
    width: 900,
    height: 680,
    webPreferences: {
      nodeIntegration: true
    }
});
Enter fullscreen mode Exit fullscreen mode

in case anyone else runs into this error

Collapse
 
okeeffed profile image
Dennis O'Keeffe

Ahhh, thanks for adding the snippet!