Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

electron Cant find module remote in the renderer process

I recently upgraded to electron v1.3 from 0.37 and get Cannot find module 'remote' in the renderer process.

Been combing through the docs and haven't been able to come up with much

here's a part of my code

RENDERER JS FILE

var remote = require('electron').remote;
const ipcRenderer = require('electron').ipcRenderer;
const session = remote.require('electron').session; //i'm trying to use the session module here
var app = remote.require('electron').app; //and here too

MAIN JS PROCESS

const {app} = require('electron')
var fs = require('fs');
const {ipcMain} = require('electron')
const {BrowserWindow} = require('electron')
const {session} = require('electron')
const {dialog} = require('electron')
like image 918
d.bayo Avatar asked Mar 11 '23 03:03

d.bayo


1 Answers

Try with this code

const app = require('electron').remote.app

And in your Main process you can do this :

const {app, ipcMain, BrowserWindow, session, dialog} = require('electron')
var fs = require('fs');
like image 109
MaximeF Avatar answered Mar 19 '23 08:03

MaximeF