laravel-mix icon indicating copy to clipboard operation
laravel-mix copied to clipboard

Notifications are disabled - Windows 10

Open ahirany opened this issue 4 years ago • 39 comments

  • 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" } }

image

ahirany avatar Feb 17 '21 08:02 ahirany

I have a same issue, please help, how to enable this notification with CMD?.

ihpack avatar Mar 07 '21 15:03 ihpack

Same issue! Help

Neo363 avatar Mar 15 '21 11:03 Neo363

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.

  1. Enable all notifications for Snoretoast in Windows Settings -> Notifications and Actions Settings

This had no effect the notification were still hidden.

  1. 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!

Uncreative-Dev avatar Mar 18 '21 13:03 Uncreative-Dev

+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).

piljac1 avatar Mar 28 '21 07:03 piljac1

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)

piljac1 avatar Mar 28 '21 17:03 piljac1

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 the setting variable remains NotificationSetting_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) and setting gets assigned NotificationSetting_DisabledForApplication.

piljac1 avatar Mar 29 '21 03:03 piljac1

Having the same issue! I've looked for "Laravel Mix" on the registry editor, tried to remove (on multiple places) but with no success

bar-lavie avatar Apr 02 '21 15:04 bar-lavie

@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.jsproblem 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 avatar Apr 14 '21 14:04 alikashfi

@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.

piljac1 avatar Apr 16 '21 04:04 piljac1

hi, i just found my solution for this error. im using laravel btw

  1. go to : [your-drive]:\[your-root-project-path]\node_modules\laravel-mix\src\components\Notifications.js

  2. 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')
            });
        }
    }
}
  1. 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

shaktisatya avatar Apr 16 '21 23:04 shaktisatya

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 avatar Apr 17 '21 01:04 thecrypticace

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.

piljac1 avatar Apr 17 '21 22:04 piljac1

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:

  1. Can we register the same App ID to different locations?
  2. If not, how do we generate and store a unique app ID?
  3. 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.
  4. 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. :(

thecrypticace avatar Apr 18 '21 12:04 thecrypticace

I have overcome this issue by SnoreToast notification On.

Rakibul8001 avatar Jun 13 '21 16:06 Rakibul8001

@Rakibul8001 can you share more details or steps to solve it?

erropix avatar Jun 15 '21 02:06 erropix

@alikashfi Your solution worked for me thank you

Nahi3an avatar Nov 22 '21 16:11 Nahi3an

Finally, the permanent solution,

  1. Remove Enable key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix

  2. 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

  1. Check the NotificationHandler table and identify Laravel Mix under PrimaryId column. Just delete the entire ~~column~~ row.

And it is..... :)

I hope it helps everyone.

lianmaymesi avatar Nov 24 '21 18:11 lianmaymesi

@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!

erropix avatar Nov 24 '21 19:11 erropix

If a collaborator can change the line below it should work on all projects:

return new WebpackNotifierPlugin({
    appID: 'Snore.DesktopToasts',
   ...
});

julesgilson avatar Nov 26 '21 14:11 julesgilson

I'll give that a test today.

thecrypticace avatar Nov 26 '21 17:11 thecrypticace

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.

thecrypticace avatar Nov 27 '21 13:11 thecrypticace

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)

Clipboard01

julesgilson avatar Nov 27 '21 15:11 julesgilson

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.

thecrypticace avatar Nov 27 '21 18:11 thecrypticace

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.

thecrypticace avatar Nov 28 '21 00:11 thecrypticace

Finally, the permanent solution,

  1. Remove Enable key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix
  2. 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

  1. Check the NotificationHandler table and identify Laravel Mix under PrimaryId column. Just delete the entire ~column~ row.

And it is..... :)

I hope it helps everyone.

It works Perfectly..

ssahmed05 avatar Dec 17 '21 05:12 ssahmed05

Finally, the permanent solution,

  1. Remove Enable key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix
  2. 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

  1. Check the NotificationHandler table and identify Laravel Mix under PrimaryId 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.

aleangelico avatar Dec 23 '21 16:12 aleangelico

Finally, the permanent solution,

  1. Remove Enable key from the Registry, HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Notifications\Settings\Laravel Mix
  2. 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

  1. Check the NotificationHandler table and identify Laravel Mix under PrimaryId 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

DRucci-88 avatar Jan 19 '22 01:01 DRucci-88

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 avatar Feb 04 '22 09:02 bhojkamal

@bhojkamal

Click the New button, select SQLite from Network Type, and chose Database Location (Which is shown in the above path)

lianmaymesi avatar Feb 04 '22 14:02 lianmaymesi

@lianmaymesi @DRucci-88

Thanks all, I am able to delete the row using DB Browser. And it it working now.

bhojkamal avatar Feb 18 '22 08:02 bhojkamal