-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Webpack 5 polyfills #199
Comments
inside my const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');
const Store = require('electron-store');
const store = new Store();
ipcMain.handle('loadContent', (e) => {
return store.get('config.key');
});
ipcMain.on('saveContent', (e, content) => {
store.set('config.key', content);
}); This works. |
@steveoh were you able to install it? curious, same problem. :) |
Yes, our issue was with the misunderstanding of where the node code was allowed to run. Using the ipc bridge to a main process allows this to work properly. |
I have the same issue and I'm not sure how @steveoh solved it. Do i need to have node integration enabled? I still get the error that I need the fs module, if I set fs; false in the fallback then I get another error fs.existsFileSync doesnt exist. |
I also tried to use a boiler template: https://github.com/electron-react-boilerplate/electron-react-boilerplate So I gave up and went for a custom implementation, but would love to replace my custom code with this package if someone finds a solution. |
See #259 (comment) |
Because of webpack 5 removing polyfills this library no longer works with the electron forge starter project.
I have been able to polyfill everything except for
fs
via theresolve.fallback
webpack config.fs
is imported fromconf
,electron
, andpath-exists
.I've tried the
resolve.preferRelative: true,
but it gives the same issue without the did you mean text.I'm not quite sure how to polyfill
fs
and if I should have to. What thoughts do folks have on this?This stack overflow question has some answers about using
window.require
but I'm not sure how that can be possible with this projects dependencies.Thanks in advance!
refs #191
The text was updated successfully, but these errors were encountered: