laravel-mix
laravel-mix copied to clipboard
Notifications are disabled - Windows 10
- Laravel Mix Version: 6.0.11 (
npm list --depth=0
) - Node Version (
node -v
): 15.8.0 - NPM Version (
npm -v
): 7.5.1 - OS: Windows 10
Description:
Laravel build notifications got disabled by itself - not sure what exactly happened and now when I run 'npm run watch' in my project folder I get the following message.
Notifications are disabled Reason: DisabledForApplication Please make sure that the app id is set correctly. Command Line: C:\wamp64\www\sterlingsilver\wp-content\themes\woocommerce-theme\node_modules\node-notifier\vendor\snoreToast\snoretoast-x64.exe -appID "Laravel Mix" -pipeName \.\pipe\notifierPipe-abb01a42-3adc-468c-a18a-8e2066933787 -p C:\wamp64\www\sterlingsilver\wp-content\themes\woocommerce-theme\node_modules\laravel-mix\icons\laravel.png -m "Build successful" -t "Laravel Mix"
I've tried uninstalling node.js, removing nodejs directories, removing nodejs from Path variable and reinstalling nodejs but to no avail.
npm -v = 7.5.1 node -v = 15.8.0 OS = Windows 10
Steps To Reproduce:
Following are my webpack.mix.js and package.json file content
webpack.mix.js -- const mix = require('laravel-mix'); mix.js('src/app.js', './') mix.sass('src/app.scss', './',[]) mix.options({ processCssUrls: false }); mix.sourceMaps()
package.json --
{ "private": true, "scripts": { "dev": "npm run development", "development": "mix", "watch": "mix watch", "watch-poll": "mix watch -- --watch-options-poll=1000", "hot": "mix watch --hot", "prod": "npm run production", "production": "mix --production" }, "devDependencies": { "axios": "^0.21", "laravel-mix": "^6.0.11", "lodash": "^4.17.19", "mini-css-extract-plugin": "^1.3.6", "postcss": "^8.1.14", "resolve-url-loader": "^3.1.2", "sass": "^1.32.7", "sass-loader": "^8.0.2" }, "dependencies": { "bootstrap": "^4.6.0", "cross-env": "^7.0.3", "jquery": "^3.5.1", "npm": "^7.5.4", "popper.js": "^1.16.1", "postcss-loader": "^5.0.0" } }
I have a same issue, please help, how to enable this notification with CMD?.
Same issue! Help
Hi,
I have the same Issue. First of all if you didn't want notifications and disabled them via Windows u can just add mix.disableNotifications()
to the webpack.mis.js file. This hides the Notifications are disabled warning.
As I wanted to get the notifications back I tried to get two things.
- Enable all notifications for Snoretoast in Windows Settings -> Notifications and Actions Settings
This had no effect the notification were still hidden.
- Enable all Notifcations for the "Laravel Mix" appId in the Windows Registry
In the Registry Editor i went to
\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix
which for me had a enabled property. I deleted that property and restarted my machine. This also had no effect as the Warning still showed up without any Notifications showing up.
Any Ideas on how to fix this would be really appreciated.
Thanks in advance!
+1
I encountered this issue today. I was tired of hearing the audio of the notification, so I just disabled the notification entirely via the notification's window cog icon, but after I did that, I encountered the same error you guys have.
I've tried different things over the span of multiple hours, but not dice unfortunately...
I tried deleting the "Enabled" property in the "Laravel Mix" notification key in the registry editor + reboot. I tried removing the key entirely + reboot. I also tried removing "Snore.DesktopToasts" + reboot.
I also found references in a Backup folder. Deleted those also, but still not working.
I think the issue might be due to the fact an AppID is specified (Laravel Mix), when Laravel Mix is not an actual app, but that's a huge guess. I tested a project that uses Laravel Mix 5 and it seems like back then it wasn't an issue because no AppID was specified (you can see "SnoreToast" at the bottom of the notification instead of "Laravel Mix").
If I run get-StartApps | Where-Object {$_.Name -like '*Snore*'}
in PowerShell, I get the following (which means Snore has a recognized AppID):
Name AppID
---- -----
SnoreToast Snore.DesktopToasts
SnoreToast Snore.DesktopToasts.0.7.0
However, if I use the same command with "Laravel" or "Mix" or "Laravel Mix", it finds no app matching that (which makes sense because Mix has no executable file).
Some links that could be useful:
https://github.com/jef/streetmerchant/issues/1035?fbclid=IwAR2Km985TroyPMBzOUW10UCdAP4DX7gdDfd5keBfkZhtSxZ4KrFY-M1jjz8#issuecomment-735821177
https://github.com/mikaelbr/node-notifier/issues/332?fbclid=IwAR0NwpnuCeW1zFFhUI4tpgmsuM8UIXmxZLVIROnouhYT7Y9wN6PuRUVaU0c#issuecomment-761808806
https://github.com/mikaelbr/node-notifier/issues/144?fbclid=IwAR2eZUJzz2LCvtUxRVd_fY9Rd6rl5d1W4ZSYPye3NzG4qjHXJbHruyWD3Y0#issuecomment-319324058
https://github.com/mikaelbr/node-notifier?fbclid=IwAR0NwpnuCeW1zFFhUI4tpgmsuM8UIXmxZLVIROnouhYT7Y9wN6PuRUVaU0c#usage-windowstoaster
(in the last link, scroll a bit and checkout out the "Windows 10 Fall Creators Update (Version 1709) Note" section)
Update (still no fix found):
I cloned SnoreToast's project and tried debugging what was happening. So I found that bit of code:
std::wstring error;
NotificationSetting setting = NotificationSetting_Enabled;
if (!ST_CHECK_RESULT(d->m_notifier->get_Setting(&setting))) {
tLog << "Failed to retreive NotificationSettings ensure your appId is registered";
}
switch (setting) {
case NotificationSetting_Enabled:
ST_RETURN_ON_ERROR(setEventHandler(d->m_notification));
break;
case NotificationSetting_DisabledForApplication:
error = L"DisabledForApplication";
break;
case NotificationSetting_DisabledForUser:
error = L"DisabledForUser";
break;
case NotificationSetting_DisabledByGroupPolicy:
error = L"DisabledByGroupPolicy";
break;
case NotificationSetting_DisabledByManifest:
error = L"DisabledByManifest";
break;
}
if (!error.empty()) {
std::wstringstream err;
err << L"Notifications are disabled\n"
<< L"Reason: " << error << L" Please make sure that the app id is set correctly.\n"
<< L"Command Line: " << GetCommandLineW();
tLog << err.str();
std::wcerr << err.str() << std::endl;
}
So what happens is the following:
- If you specify a random App ID in the command line, it enters the first
if
and logs "Failed to retreive NotificationSettings ensure your appId is registered" somewhere (not visible in output), but thesetting
variable remainsNotificationSetting_Enabled
, so the notification is shown correctly. - However, if I enter the App ID that is used by the compiler (Laravel Mix), it doesn't enter the first
if
(so that means a notifier setting is indeed found) andsetting
gets assignedNotificationSetting_DisabledForApplication
.
Having the same issue! I've looked for "Laravel Mix" on the registry editor, tried to remove (on multiple places) but with no success
@piljac1 @bzioni
hi guys. i found something!
if we change appID from 'Laravel Mix'
to (for example) 'Laravel Mix Plus'
in node_modules\laravel-mix\src\components\Notifications.js
✅ problem solves!
let AutomaticComponent = require('./AutomaticComponent');
class Notifications extends AutomaticComponent {
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
if (Mix.isUsing('notifications')) {
let WebpackNotifierPlugin = require('webpack-notifier');
return new WebpackNotifierPlugin({
appID: 'Laravel Mix Plus',
title: 'Laravel Mix',
alwaysNotify: Config.notifications.onSuccess,
timeout: false,
hint: process.platform === 'linux' ? 'int:transient:1' : undefined,
contentImage: Mix.paths.root('node_modules/laravel-mix/icons/laravel.png')
});
}
}
}
module.exports = Notifications;
i know this is not a true way but it works :)) (i guess problem is deeply from SnoreToast). and i did it because of this first solution in Common Issues section in this page https://www.npmjs.com/package/node-notifier
and btw if after this you still couldn't see mix notifications try rollback what you did in windows registery, by doing this: save below code in a somename.reg file and run it:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix]
"LastNotificationAddedTime"=hex(b):b0,98,72,ef,43,22,d7,01
"Enabled"=dword:00000001
- sry for bad english 😔 hope it helps 😊
@alikashfi It is something I tried as I stated in my latest reply:
So what happens is the following:
- If you specify a random App ID in the command line, it enters the first if and logs "Failed to retreive NotificationSettings ensure your appId is registered" somewhere (not visible in output), but the setting variable remains NotificationSetting_Enabled, so the notification is shown correctly.
In my case, I tried running the command manually with "Laravel Fake Mix" instead of "Laravel Mix", which worked as you also tried. However, to me it is not a viable fix. It might be for some that really want it to "work" for now though.
hi, i just found my solution for this error. im using laravel btw
-
go to : [your-drive]:\[your-root-project-path]\node_modules\laravel-mix\src\components\Notifications.js
-
change :
class Notifications extends AutomaticComponent {
/**
* webpack plugins to be appended to the master config.
*/
webpackPlugins() {
if (Mix.isUsing('notifications')) {
let WebpackNotifierPlugin = require('webpack-notifier');
return new WebpackNotifierPlugin({
// appID: 'Laravel Mix', <--- this line
appID: 'SnoreToast', <--- to this line
title: 'Laravel Mix',
alwaysNotify: Config.notifications.onSuccess,
timeout: false,
hint: process.platform === 'linux' ? 'int:transient:1' : undefined,
contentImage: Mix.paths.root('node_modules/laravel-mix/icons/laravel.png')
});
}
}
}
- then create SnoreToast using : [your-drive]:\[your-root-project-path]\snoretoast-x64.exe -install 'SnoreToast' [your-drive]:\[your-root-project-path]\node_modules\node-notifier\vendor\snoreToast\snoretoast-x64.exe 'SnoreToast'
note : you have to do this for seperate projects you have, but well, it's better than nothing right.
hope this solution works for you too guys
Hmm none of this is ideal. I really need to look into this on my Windows machine. I'll do that this weekend and see if I can figure out a good solution.
Hmm none of this is ideal. I really need to look into this on my Windows machine. I'll do that this weekend and see if I can figure out a good solution.
@thecrypticace That's great ! Let us know how it goes, because the suggested "modify code in your node_modules" solutions are not viable solutions in my book. Let me know if you need a hand. I spent hours on trying to find a fix and tried multiple things, but came up empty, but I'd be glad to take another look.
I did a small amount of digging yesterday and it seems a lot of this was caused by the Fall Creators Update to Windows 10. It appears that we'll have to issue that installation command once whenever someone uses Mix.
There's a few things I'm not yet sure of though:
- Can we register the same App ID to different locations?
- If not, how do we generate and store a unique app ID?
- How do we do this registration only once per node_modules dir? We don't want to do this every time because of process startup time considerations.
- Does registering / installing the app multiple times cause problems?
Also, it appears that the app will be added to the user's start menu app list and I believe that is required. :(
I have overcome this issue by SnoreToast notification On.
@Rakibul8001 can you share more details or steps to solve it?
@alikashfi Your solution worked for me thank you
Finally, the permanent solution,
-
Remove
Enable
key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix -
Find
wpndatabase.db
from the below path, and open with any of your DB editors (I used HeidiSQL)
C:\Users\<Username>\AppData\Local\Microsoft\Windows\Notifications
- Check the
NotificationHandler
table and identifyLaravel Mix
underPrimaryId
column. Just delete the entire ~~column~~ row.
And it is..... :)
I hope it helps everyone.
@thecrypticace I think this issue is easy to solve, why not have an option to change the App ID that gets passed to the WebpackNotifierPlugin!
If a collaborator can change the line below it should work on all projects:
return new WebpackNotifierPlugin({
appID: 'Snore.DesktopToasts',
...
});
I'll give that a test today.
I remembered why we "can't" do that — because notifications are only attributed to applications installed in the start menu on windows now and that's how the title is determined. Which attributes the title as "SnoreToast" instead of "Laravel Mix". So the only true solution is to run the install command if the app doesn't exist in the start menu.
I would very much like some other option though because that's really inconvenient to have to deal with.
I remembered why we "can't" do that — because notifications are only attributed to applications installed in the start menu on windows now and that's how the title is determined. Which attributes the title as "SnoreToast" instead of "Laravel Mix". So the only true solution is to run the install command if the app doesn't exist in the start menu.
I would very much like some other option though because that's really inconvenient to have to deal with.
Not sure what you mean, SnoreToast will have to be "installed" and in the start menu - but just once. The node-notifier package has a method notifierExists
to check if the executable is already installed. Below is the resulting toast in Windows with appID: 'Snore.DesktopToasts'
, the title is still Laravel Mix (not that I expect anyone would be that bothered if it wasn't - better than an error)
It was specifically updated to handle this issue: https://github.com/laravel-mix/laravel-mix/issues/2671
But I think changing it back is probably best. sigh
I'll do a few tests and make the update later this evening. Thanks.
The only way I can get this error to happen is:
- Changing the app ID to "Snore.DesktopToasts"
- Run Mix
- Then go to settings
- Disable notifications for "SnoreToast" OR disable them globally
- Run Mix again
If the App ID is anything else it doesn't show up in notification settings, they cannot be disabled, and notifications work fine.
I'd like to properly solve this but I need to be able to reliably reproduce the problem in the current configuration to be sure any changes we make actually fix them.
Can some of you provide OS version details because as it stands this issue seems like it doesn't exist in Windows 11. So maybe it's a windows 10 only problem now.
Finally, the permanent solution,
- Remove
Enable
key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix- Find
wpndatabase.db
from the below path, and open with any of your DB editors (I used HeidiSQL)
C:\Users\<Username>\AppData\Local\Microsoft\Windows\Notifications
- Check the
NotificationHandler
table and identifyLaravel Mix
underPrimaryId
column. Just delete the entire ~column~ row.And it is..... :)
I hope it helps everyone.
It works Perfectly..
Finally, the permanent solution,
- Remove
Enable
key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix- Find
wpndatabase.db
from the below path, and open with any of your DB editors (I used HeidiSQL)
C:\Users\<Username>\AppData\Local\Microsoft\Windows\Notifications
- Check the
NotificationHandler
table and identifyLaravel Mix
underPrimaryId
column. Just delete the entire ~column~ row.And it is..... :)
I hope it helps everyone.
Great!, this worked for me, I used DB Browser for SQLite to change wpndatabase.db.
Finally, the permanent solution,
- Remove
Enable
key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix- Find
wpndatabase.db
from the below path, and open with any of your DB editors (I used HeidiSQL)
C:\Users\<Username>\AppData\Local\Microsoft\Windows\Notifications
- Check the
NotificationHandler
table and identifyLaravel Mix
underPrimaryId
column. Just delete the entire ~column~ row.And it is..... :)
I hope it helps everyone.
This also worked for me, Thank you Sensei, I used DB Browser to edit wpndatabase.db
Hello, How to edit wpndatabase.db in HeidiSQL.? I've installed HeidiSQL too. but I don't see option to open file. How else we can delete row primaryId of Laravel Mix?
@bhojkamal
Click the New
button, select SQLite
from Network Type, and chose Database Location (Which is shown in the above path)
@lianmaymesi @DRucci-88
Thanks all, I am able to delete the row using DB Browser. And it it working now.