electron-store
electron-store copied to clipboard
Electron hangs after reloading when store is initialised in the app (ui) part
Hi,
Electron hangs after reloading when store is initialised in the app (ui) part
const store = new ElectronStore();
const App = () => {
useMount(() => {
(async () => {
await ipcRenderer.invoke(Actions.RESIZE, 500);
})();
});
return (
<ReqoreUIProvider theme={{ main: '#0d0221' }}>
<ReqoreLayoutContent style={{ height: '100%' }}>
<ReqoreContent>agasgasg</ReqoreContent>
</ReqoreLayoutContent>
</ReqoreUIProvider>
);
};
ReactDOM.render(<App />, document.getElementById('app'));
The whole process including dev tools hangs.
Also when initialising the store in the main process using Store.initRenderer
an error cannot find module ajv/dist/compile/context
is thrown. This is on latest Electron and M1 Mac.
I'd like to add that I'm having the same error. OS: Ubuntu 20.04.2 Electron: 12.0.1 Electron-Store: 7.0.2
having the same behavior Cannot find module 'ajv/dist/compile/context'
tried with ipcMain => ipcRenderer
and the initRenderer()
~~I'm in same situation, I can't use Elements, Console, Source ... in Dev Tools after reload.~~
~~And an app takes almost 10 seconds for startup.~~
Edit: It's resolved after put import Store from "electron-store";Store.initRenderer()
to index.electron.ts
. But in the development environment, initRenderer()
succeeds, but in the production build, Cannot find module 'ajv/dist/compile/context'
occurs.
Edit2: After add all requirements of this package to app bundle, it was resolved. (my electron-builder.yml). The collection of requirements was done by this.
OS: macOS Catalina 10.15.7 Electron: 12.0.1 electron-store: 7.0.2
same issue where, getting the
Cannot find module 'ajv/dist/compile/context'
error message and nothing seems to fix it.
Version 6.0.1 works without any problem, Version 7 has this error.
OS: Windows 10 Electron: 12.0.1 electron-store: 7.0.2