Open ivxvm opened 1 year ago
I ran into the same issue.
Attached is a screenshot of the error message I get.
The docs seem to be out of date as you can't create a store in the renderer process anymore. Everything works great if I only create my store in the main process and use IPC to communicate. Electron React Boilerplate project has some useful docs on this.
https://electron-react-boilerplate.js.org/docs/electron-store
My solution was to make a super simple version of electron-store that works for my needs. At the time of this writing electron-store doesn't work with apps packaged with electron-forge, or at least it didn't work for me. I made a gist of what I did for anyone having this problem: https://gist.github.com/steve981cr/499dae0c2a4c6340d0f35656dae92020
After some research, i found a solution:
target: "electron-main",
import type {Configuration} from 'webpack';
import {rules} from './webpack.rules'; import {plugins} from './webpack.plugins';
export const mainConfig: Configuration = { entry: './src/index.ts', target: "electron-main", // <-- PUT IT HERE module: { rules, }, plugins, resolve: { extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'], }, };
2. Need to add in renderer webpack config ```target: "electron-renderer",```
```typescript
import type { Configuration } from 'webpack';
import { rules } from './webpack.rules';
import { plugins } from './webpack.plugins';
rules.push({
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }],
});
export const rendererConfig: Configuration = {
target: "electron-renderer", // <-- PUT IT HERE
module: {
rules,
},
plugins,
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css'],
},
};
Hello, seems like this library doesn't work anymore with recent electron ecosystem.
Errors I get: