Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Unable to Import or Use Electron #28

Open
AvIsBeastMC opened this issue Nov 12, 2021 · 2 comments
Open

Unable to Import or Use Electron #28

AvIsBeastMC opened this issue Nov 12, 2021 · 2 comments

Comments

@AvIsBeastMC
Copy link

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

@riyaz7us
Copy link

riyaz7us commented Nov 22, 2021

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

@AvIsBeastMC
Copy link
Author

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants