Skip to content
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

Can't resolve 'fs' #36

Closed
johannesjo opened this issue Aug 1, 2020 · 4 comments
Closed

Can't resolve 'fs' #36

johannesjo opened this issue Aug 1, 2020 · 4 comments

Comments

@johannesjo
Copy link

As soon as I use this in my webpack build (via angular cli) for the renderer I get the error above.

import { ipcRenderer } from 'electron-better-ipc';
console.log(ipcRenderer);

Leads to:

Module not found: Error: Can't resolve 'fs' in '/home/mememe/www/super-productivity/node_modules/electron'
@sindresorhus
Copy link
Owner

That is a problem with Webpack. Use the Webpack support channels. It works find when run directly without Webpack.

@johannesjo
Copy link
Author

Setting

  node: {
    fs: 'empty'
  }

in the webpack config which seems to be the standard workaround for this doesn't work for me as I am now with the error fs.existsSync is not a function. I am using electron 9.1.1.

@serg06
Copy link

serg06 commented Aug 18, 2021

@johannesjo Did you ever figure it out?

@serg06
Copy link

serg06 commented Aug 18, 2021

Update, I got it working here.

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

No branches or pull requests

3 participants