Closed zeroslope closed 5 years ago
@zeroslope Thank you for your reporting this issue 👍
I fixed nextron@3.5.20
:
# install latest nextron
$ npm install --global nextron@latest
# test it
$ nextron init my-app --template ipc-communication
$ cd my-app
$ yarn && yarn dev
Thank you for your contribution to open source. The Ipc problem is due to the listener not deleted.
The most difficult is another problem that I can't output anything in the command after reload.
The first time I run yarn dev
, I click ipc then output '1'
I change it to '2', then reload, It output nothing.
I don't know why.
I just published nextron@3.6.0
and fixed this issue 👍
$ npm i -g nextron@latest
$ nextron init test-ipc -t ipc-communication
$ cd test-ipc
$ yarn && yarn dev
@zeroslope
Thank you for your details 💯
I got it like this: (this is a little tricky)
build/nextron-dev.js
main/helpers/enable-hot-reload.js
So this missing console output bug happens.
I changed main/helpers/enable-hot-reload.js
to main/helpers/exit-on-change.js
and always start the electron process from build/nextron-dev.js
.
Thanks for your help! 👍
ipcMain.on() still run after background hot reload
you can add
alert('a')
on this line https://github.com/saltyshiomix/nextron/blob/6910b108cd6596bf493db1bd717322c742b4e536/examples/ipc-communication/renderer/pages/home.jsx#L24and then reload background.js, click the button, you can see two alert; reload again, you can see three alert.
and after reload, the output won't appear on console.