nuxtron
nuxtron copied to clipboard
Unable to Import or Use Electron
Hey there
I am facing this error when I am trying to import Electron in renderer/pages/login.vue component, I am trying to import it like this
I have fs installed in node_modules and here's my package.json
Can someone help me fix this bug? Thank you
Found this fix from Nextron (next.js) github issue
Use:
const {ipcRenderer} = eval('require(\'electron\')');
instead of:
import {ipcRenderer} from 'electron';
or const {ipcRenderer}=require('electron');
Found this fix from Nextron (next.js) github issue Use:
const {ipcRenderer} = eval('require(\'electron\')');
instead of:
import {ipcRenderer} from 'electron';
orconst {ipcRenderer}=require('electron');
thanks a lot @riyaz7us!