I've electron app with Angular frontend.
Here is my preload.js file:
const { ipcRenderer, contextBridge } = require("electron");
const Store = require("electron-store");
const store = new Store({
encryptionKey: "my-secret-encryption-key",
});
When I use Store in above way I got the error:
Unable to load preload script: /home/Documents/todo-desktop/src/app/app-preload.js
(anonymous) @ VM4 sandbox_bundle:2
VM4 sandbox_bundle:2 Error: module not found: electron-store
at preloadRequire (VM4 sandbox_bundle:2:82751)
at <anonymous>:3:15
at runPreloadScript (VM4 sandbox_bundle:2:83503)
at VM4 sandbox_bundle:2:83762
at VM4 sandbox_bundle:2:83917
at _electron_webpack_init (VM4 sandbox_bundle:2:83921)
at VM4 sandbox_bundle:2:84044
(anonymous) @ VM4 sandbox_bundle:2
As soon as I remove Store from ui, I didn't get any error. Following code didn't give any reason.
const { ipcRenderer, contextBridge } = require("electron");
Since ipcRenderer, contextBridge is working correctly, why Store is not working?