Greetings,
I need some help π
I've been trying to implement some data persistance using electron-store. But somehow, when I import it in the renderer process, the compilation keeps failing and throwing errors. I'm using VueJS.
The error messages
Module not found: Error: Can't resolve 'path' ...
Module not found: Error: Can't resolve 'fs' ...
Module not found: Error: Can't resolve 'crypto' ...
config.js which is located in src folder.
const Store = require('electron-store');
const schema = {
general: {
type: 'object',
properties: {
gpu: { type: 'boolean' },
openOnStartup: { type: 'boolean' },
tray: { type: 'boolean' },
},
default: {
gpu: true,
openOnStartup: false,
tray: true,
}
},
theme: {
type: 'object',
properties: {
modes: {
type: 'string',
enum: ['dark', 'light', 'system'],
default: 'dark',
},
themes: {
type: 'object',
properties: {
name: { type: 'string'},
colours: {
type: 'array',
items: {
type: 'string'
},
// TODO: Add default theme
default: [],
}
}
}
}
}
};
const config = new Store({schema});
export default config;
<script>
import config from "/src/config";
console.log(config.get('general'))
</script>
Importing it only into the main process works fine. But the adding it to a renderer process from a vue component throws those errors mentioned above.
package.json dependencies
"dependencies": {
"electron": "^15.3.1",
"electron-store": "^8.0.1",
}
Tried to follow the same configuration as Caprine's config but I still get the same errors.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too