saltyshiomix / nuxtron

⚡ Nuxt.js + Electron ⚡

Home Page:https://npm.im/nuxtron

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to Import or Use Electron

AvIsBeastMC opened this issue · 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

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'; or const {ipcRenderer}=require('electron');

thanks a lot @riyaz7us!