Closed seahindeniz closed 1 year ago
Hi @seahindeniz , you can try declaring dependencies like that as external, for example, in electron-vite you can do this!
Also, you can handle the handler as callback on main process, so you avoid imports that can't be joined on both process:
ipcMain.handle.getPing(async (_, { getPing, data }) => {
// call the registered handler if needed
const response = await getPing(_, data)
await ipcMain.invoke.getPong(mainWindow, 'pong')
ipcMain.remove.getPing()
return 'The getPong ipc was removed'
})
I'll try your suggestion. If it doesn't work out, I'll try to create a repro case
@seahindeniz any news?
Hello, I'm not sure if interprocess supports any other way to set handlers but following the suggested usage in https://github.com/daltonmenezes/interprocess#-usage section, and importing a dependency to use it in a handler that depends on
fsevents.node
creates a problem.Is there a way to separate the shared ipcs file into each scope so that imported modules won't get interfere with renderer/main scopes?