Cant receive ipc msg after webpack hot reload
See original GitHub issuemain.js
ipcMain.answerRenderer(IPCMsg.GetConfig, () => { return config.data })
renderer.js
async load () { let data = await ipcRenderer.callMain(IPCMsg.GetConfig) console.log(data) }
Everything is normal at startup, but after modifying some code to trigger a hot update, ipcRenderer can only send messages, can’t receive messages.
In electron-better-ipc/source/renderer.js:6
const ipc = Object.create(ipcRenderer);
Modify to
const ipc = ipcRenderer;
Fixed this bug
I don’t know why
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (3 by maintainers)
Top Results From Across the Web
webpack-dev-server hot reload not working - Stack Overflow
After reload the "Webpack Dev Server", the "Hot Reload" works, at least, after saving any change in CSS or JS files.
Read more >DevServer - webpack
If you want to manually recompile the bundle, navigating to the /webpack-dev-server/invalidate route will invalidate the current compilation of the bundle and ...
Read more >fork-ts-checker-webpack-plugin - npm
Runs typescript type checker and linter on separate process.. Latest version: 7.2.14, last published: 14 days ago.
Read more >Interop's Labyrinth: Sharing Code Between Web & Electron ...
Things aren't always what they seem in this place, so you can't take anything ... but since these remote method calls boil down...
Read more >webContents | Electron
Emitted when the renderer process sends an asynchronous message via ipcRenderer.send() . See also webContents.ipc , which provides an IpcMain -like interface ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Correct
@sindresorhus Thanks for the response. Makes sense. Although when I asked, I was thinking of the following alternative:
And then in the places where you use standard electron IPC APIs:
But I think I know the answer. You chose to provide a “better” IPC (hence the name of the package!), so you wanted all standard APIs to also exist in your exported object. Am I correct?