Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENAMETOOLONG on Windows #20

Closed
sgehrman opened this issue Nov 27, 2017 · 20 comments
Closed

ENAMETOOLONG on Windows #20

sgehrman opened this issue Nov 27, 2017 · 20 comments

Comments

@sgehrman
Copy link

This has been working great for a while, but now getting this:

using electron-webpack, all packages are updated

Error: spawn ENAMETOOLONG
at _errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at exports.spawn (child_process.js:502:9)
at Object.exports.execFile (child_process.js:212:15)
at Object.module.exports.fileCommand (f:\Github\eth-client\node_modules\node-notifier\lib\utils.js:53:13)
at WindowsToaster.notify (f:\Github\eth-client\node_modules\node-notifier\notifiers\toaster.js:65:9)
at WebpackBuildNotifierPlugin.onCompilationDone (f:\Github\eth-client\node_modules\webpack-build-notifier\index.js:172:18)
at Compiler.applyPlugins (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:61:14)
at Watching._done (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:104:17)
at onCompiled (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:54:18)
at applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:514:14)
at next (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:202:11)
at Compiler. (f:\Github\eth-client\node_modules\webpack\lib\CachePlugin.js:78:5)
at Compiler.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:206:13)
at compilation.seal.err (f:\Github\eth-client\node_modules\webpack\lib\Compiler.js:511:11)
at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46)
at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:680:19)
at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46)
at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:671:11)
at Compilation.applyPluginsAsyncSeries (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:195:46)
at self.applyPluginsAsync.err (f:\Github\eth-client\node_modules\webpack\lib\Compilation.js:666:10)
at next (f:\Github\eth-client\node_modules\tapable\lib\Tapable.js:202:11)

@RoccoC
Copy link
Owner

RoccoC commented Nov 29, 2017

Thanks for the report.

I see you've found the related node-notifier issue (mikaelbr/node-notifier#145), but I will see if there's anything I can do to debug this from my side.

@sgehrman
Copy link
Author

Found out that if there is a large error it fails. I keep seeing this if git converts LF to CRLF then every CR is an error the linter and makes every line an error.

@RoccoC
Copy link
Owner

RoccoC commented Nov 30, 2017

In that case, we could probably truncate/limit the error string to a max length before calling notify(). Will have a look today.

@RoccoC
Copy link
Owner

RoccoC commented Nov 30, 2017

@sgehrman, can you please confirm your Windows version as well as the version of node-notifier that you have installed?

RoccoC added a commit that referenced this issue Nov 30, 2017
@RoccoC
Copy link
Owner

RoccoC commented Nov 30, 2017

@sgehrman, this has been fixed in the latest version (0.1.18). Can you give it a go and let me know if it resolves your issue?

@RoccoC RoccoC closed this as completed Nov 30, 2017
@sgehrman
Copy link
Author

Thanks for looking at this. I don't seem to see any notifications now, but it didn't crash like before. I'll do some more testing to confirm, but check if it gives any notifications on Windows.

@sgehrman
Copy link
Author

sgehrman commented Nov 30, 2017

yeah, no messages now. I think this is wrong.

You changed it, but your change seems incorrect.

+WebpackBuildNotifierPlugin.prototype.defaultMessageFormatter = function(error, filepath) {
return filepath + os.EOL + (error.message ? error.message.replace(error.module ? error.module.resource : '', '') : ''); return filepath + os.EOL + (error.message ? error.message.replace(error.module ? error.module.resource : '', '') : '');
}; };

Just wondering why you changed it to defaultMessageFormatter, but I don't know this code well.

@RoccoC
Copy link
Owner

RoccoC commented Nov 30, 2017

Hmm, I tested on Windows 10 Version 1703 (OS Build 15063.726) using node-notifier v5.1.2. Let me know if you are still having issues and whether your setup is different.

What seems to be the problem with the change you referenced?

@sgehrman
Copy link
Author

sgehrman commented Nov 30, 2017

Oh, I'm just guessing. The change to limit the message size looked fine, but not sure why you made the other change. Or maybe the new node-notifier is broken. I'll do some more testing on my end. I trashed my node_modules and got all the code fresh, try that.

@sgehrman
Copy link
Author

I'm Windows Pro 1709 build 16299.64

@RoccoC
Copy link
Owner

RoccoC commented Dec 1, 2017

OK, will investigate today.

@RoccoC RoccoC reopened this Dec 1, 2017
@RoccoC
Copy link
Owner

RoccoC commented Dec 5, 2017

@sgehrman, looks to be an issue with Windows build 1709: mikaelbr/node-notifier#206

@sgehrman
Copy link
Author

sgehrman commented Dec 5, 2017 via email

RoccoC added a commit that referenced this issue Dec 13, 2017
@RoccoC
Copy link
Owner

RoccoC commented Dec 13, 2017

@sgehrman, I finally updated to Windows build 1709 (Fall Creator's Update) and was able to reproduce. The latest version of webpack-build-notifier (0.1.19) should now generate notifications in Windows. Can you please take a look and let me know if you are still having issues?

@RoccoC RoccoC closed this as completed Dec 13, 2017
@sgehrman
Copy link
Author

doesn't seem to work. Maybe I'm just confused, I'll do some more tests.

@RoccoC
Copy link
Owner

RoccoC commented Dec 14, 2017

Hmm, OK...can you run the following command in powershell and post back with the output (if any)?

Get-StartApps | Select-String -Pattern "node.exe"

@RoccoC RoccoC reopened this Dec 14, 2017
@sgehrman
Copy link
Author

@{Name=Node.js; AppID={6D809377-6AF0-444B-8957-A3773F02200E}\nodejs\node.exe}

@RoccoC
Copy link
Owner

RoccoC commented Dec 14, 2017

Thanks for the quick reply.

This is what I am expecting, must be something else going on. I will look into how notifications work on Windows to see what I can find out.

@RoccoC
Copy link
Owner

RoccoC commented Dec 14, 2017

OK! I am hoping my latest commit (df8e499) has fixed this issue for those on Windows build 1709.

Seems that prior to this Windows build there was a bug/loophole where any app could generate notifications, rather than known/installed apps (there are several posts around the interwebs describing this, e.g. https://stackoverflow.com/a/46817674/181483). The fix I've decided to implement entails ensuring that the SnoreToast executable (which node-notifier depends on to generate Windows notifications) has an appID, and then using that for the notifications. The downside is that each notification will be suffixed with "SnoreToast", but it at least works. :) If I come up with a better way I will definitely revisit.

Let me know if you have further issues! ;)

@RoccoC RoccoC closed this as completed Dec 14, 2017
@RoccoC
Copy link
Owner

RoccoC commented Dec 14, 2017

FYI, the fix is in webpack-build-notifier@0.1.21 which is now published to the npm registry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants