nuxtron icon indicating copy to clipboard operation
nuxtron copied to clipboard

Unable to Import or Use Electron

Open AvIsBeastMC opened this issue 2 years ago • 2 comments

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 image image I have fs installed in node_modules and here's my package.json image Can someone help me fix this bug? Thank you

AvIsBeastMC avatar Nov 12 '21 03:11 AvIsBeastMC

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');

riyaz7us avatar Nov 22 '21 09:11 riyaz7us

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');

thanks a lot @riyaz7us!

AvIsBeastMC avatar Dec 14 '21 04:12 AvIsBeastMC