electron-store icon indicating copy to clipboard operation
electron-store copied to clipboard

Electron hangs after reloading when store is initialised in the app (ui) part

Open Foxhoundn opened this issue 3 years ago • 4 comments

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.

Foxhoundn avatar Mar 12 '21 15:03 Foxhoundn

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

SwanX1 avatar Mar 15 '21 11:03 SwanX1

having the same behavior Cannot find module 'ajv/dist/compile/context'

tried with ipcMain => ipcRenderer

and the initRenderer()

allandiego avatar Mar 24 '21 19:03 allandiego

~~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

ci7lus avatar Mar 26 '21 10:03 ci7lus

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

iamisti avatar Apr 09 '21 21:04 iamisti