Skip to content

Error: [Vuex Electron] Reached timeout waiting for renderer to connect #212

Answered by BetaHuhn
klakhov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @klakhov,

the problem is how or more precisely when you are using PersistedState.getStoreFromRenderer();.

It basically initialises the IPC listeners in the main process which will be connected to once you call this.$store.commit('setUsername', 'user'). You are only initializing the listeners after window.ipcRenderer.send("start") was called which means at the point where the renderer tries to connect to the main process with .commit() it is not listening yet.

To fix this, move const store = await PersistedState.getStoreFromRenderer() out of the ipcMain.on("start") IPC event listener so vuex-electron-store can initialise the listeners before the renderer tries to send an event:

app.on('…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by klakhov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants