Open MiniSuperDev opened 1 year ago
Please provide a minimum demo. thanks
@RSS1102 Hi, I update the issue with an example
ipcMain.handle("getDate", () => {
return `Other String:` + `${Date.now()}`;
})
This is the code for the Electron process. When you try to change the code here and save it, the program will reload.. This is inevitable
@RSS1102 I see, in my VS Code, when save it, it not reload the app, so I need to restart manually
@RSS1102 I see, in my VS Code, when save it, it not reload the app, so I need to restart manually
I'm not quite sure about this, maybe it's because of your vscode? If possible, you can try changing to a different computer.
@RSS1102 I checked, it works when you run from npm run dev
But the error happens (not reload) when launch using the vs code launch Debug App
(F5)
I have the same problem (I think, it's a bit hard to understand). When I change something in src\main\index.ts
for example ipcMain.on('ping', () => console.log('ponggggg'))
I need to stop and start the application again. there is no hot reload or anything for the main process. I'm just using npm run dev nothing else.
For example I'm using IPC, but when change an implementation of a method of the IPC, this change is not showed in real time like when do a change in the renderer, currently I do manually restart to see the changes in the app.
Example: https://github.com/MiniSuperDev/electron-vite-react-main-reload/tree/main
Change this:
https://github.com/MiniSuperDev/electron-vite-react-main-reload/blob/main/electron/main/index.ts#L123-L128
For this:
You notice that the message is the previous.
I think it should restart the app, or do a hot reload if possible. Thanks