I have this minimal electron app, which communicates with the python backend on clicking a button and logs the response in the console. The issue is that the result is logged twice every time the button is clicked twice. Nothing happens when the button is clicked once, although I have noticed (using ps aux) that a child process is indeed spawned.
How can I fix this (get the result from python every single time the button is clicked)?
I made this github gist containing the relevant code. One just needs to run
npm install and
npm start to run the application.