New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module not found: Can't resolve 'fs' in 'node_modules\electron' #2961
Comments
|
I was struggling with the same thing and I originally thought the solution I linked was the correct approach (first day on electron). But I'm now understanding that IPC is designed to solve the security problem that we're introducing with the link I shared. Take a look at the IPC event emitted in So, you shouldn't need to import ipcRenderer directly into your renderer |
|
Thanks for your comment. My goal is to close, minimize and maximize the electron window from a react component. |
Try this answer. Basically the problem is Typescript doesn't recognize Anything exposed in the |
TLDR; if you have an import of |
I did that, but I can see it's not the first thing to do. The first thing to do is: do NOT import directly in ./src/main/preload.ts there is
then you can
and job done |
|
Hi all ! For all interested in use ipcRenderer, here is a example how to use it: |
Summary
I am experiencing issues importing packages. Here, i imported ipc using
import { ipcRenderer } from 'electron'.However, it doesn't matter what i import - it occurs with every package i use in React components.
I'm pretty new to Electron, but not to React (maybe i'm overlooking something?).
This post didn't help me, but might be related.
My environment
node: 16.8.0
npm: 7.21.0
yarn: 1.22.11
The text was updated successfully, but these errors were encountered: