webpack-build-notifier
webpack-build-notifier copied to clipboard
Notifications not showing up on Windows 10
After an update to Windows 10 1903, notifications stopped popping up. They do show up as notifications in the notification area after a reboot. Any ideas?
Hi @david-hollifield , thanks for the report! I'm seeing the same thing after upgrading to Windows 10 1903 as well. I will investigate, but may be something that needs to be addressed in node-notifier
: https://github.com/mikaelbr/node-notifier/issues/277.
Hi @RoccoC, I'm experiencing the same issue. I notice in your call to notifier.notify you set the wait flag to !buildSuccessful. So that means wait is set to false. On the node-notifier link you posted, wait should be set to true to work around the windows issue. Is that maybe something you can change in your code, or is there a reason you don't want to set wait to true?
PS. I changed the wait to true on my local version and it now shows the notification
Hi @quintonn, good question. Setting wait
to true does fix the issue with missing notifications in Windows 10, but it also prevents the webpack build from completing until the notification is dismissed, which would regress #45.
I suppose we could temporarily set wait to true on Windows machines until the root cause is fixed? Alternatively, we could allow the consumer to override the wait option via config? Thoughts?
Hi @RoccoC, I didn't realize it prevents a build until the notification is dismissed. Would it help calling the notify with setTimeout? I tested it on my computer and it seemed ok. I will create a PR and you can decide if you want to keep it.
This fix might fix bug 45 also?
@quintonn , just tested out your PR, thanks. In my testing it seems that while the notification is now shown consistently in Windows (due to setting wait
to true
), the build is still blocked until the notification is dismissed. I wonder if we could instead fork a detached process to dispatch the notification? I'll try and think of other solutions, open to any suggestions as well. :)
@quintonn, I think I've come up with a fix. Would you mind testing using the bugfix/blocking-notifications
branch to ensure that 1) notifications appear as expected and 2) the build is no longer blocked when a notification is dispatched?
Note that in the case of error notifications, the build will always be blocked until the notification is dismissed, however.
You can target the branch version by updating the dependency in your project's package.json
as follows:
"webpack-build-notifier": "RoccoC/webpack-build-notifier#bugfix/blocking-notifications"
Let me know how it goes, thanks!
I've tested this change but i don't see notifications now. But looking at the index.js file, you've removed the setTimeout on the call to notifier.notify.
And also wait is set to !buildstatus again, which is false.
If i set wait to true, i see the notification but build doesn't complete. It needs to the timeout feature for this to work i think.
But i am wondering if all of this is worth it, The fix should be in node-notifier.
If i put the setTimeout back on the notifier.notify call and with webpack watch, if i make a change, save it, it shows the notification, and without closing the notification, if i make another change and save it, it shows another notification.
I think the issue might be related to the fact that Node only uses 1 thread, so the setTimeout only moves that call to be the last call being executed, so it will always wait for the notification to be dismissed if we set wait to true.
Which version of webpack is your project using?
"webpack": "^4.39.2", "webpack-build-notifier": "RoccoC/webpack-build-notifier#bugfix/blocking-notifications",
I see there is a bit newer version. will try that one
On new version it showed the notification on the first build without waiting for the notification to be dismissed, perfect. But on second and 3rd builds it doesn't show. Error shows and waits till i dismiss the notification.
Using webpack watch also does not show the notification anymore.
Ps. i'm going on holiday today, so won't be able to help with this for a while
Maybe updating to the latest node-notifier (with latest SnoreToast) will resolve this issue.
https://github.com/mikaelbr/node-notifier/issues/277#issuecomment-534213576
👀
I've updated to [email protected]
. This appears to have fixed the issue. Please let me know if you still have issues after upgrading to [email protected]
.
@RoccoC Works great! Thank you!
Great, thanks for verifying!
I'm not sure what's happened, but notifications have stopped working again :(.
@david-hollifield -- apologies for the delay in my response. I will have a look this morning.