Closed nschoe closed 7 years ago
I've just had exactly the same experience; this code is all that is required to reproduce the problem:
var Syslog = require('modern-syslog');
Syslog.log(Syslog.LOG_WARNING, "hello");
Output is:
$ node test/test-syslog.js
undefined:0
TypeError: undefined is not a function
This happens on 32-bit node v6.5.0 running on Debian 8, using modern-syslog 1.1.3 installed via npm.
The fix is already complete one month ago in https://github.com/strongloop/modern-syslog/pull/17 but not released on npm - please release a new version, this just cost me 8 hours of trial and error to track down the cause
+1, please cut a new release for node v6 compatibility.
I'm glad I'm not the only one. Seems weird they don't respond, I hope they will npm publish soon.
I found that to use the plugin direct from git instead of the npm one, change the package.json to this:
"dependencies": {
"modern-syslog": "git+https://github.com/strongloop/modern-syslog.git"
So I've updated node to 6.4.0 and the application was crashing severely and my handler for
process.on ('uncaughtException')
was triggered. It is passed anerr
argument which I displayed on the console.Weirdly, what I got on the console was:
TypeError: undefined is not a function
. That's it, no stack, no code, nothing. Theerr
object was an instance orError
, but that's all. I could no get any information from where the bloody error came from.We kept stuck on this for 3 entire days ^^
We have finally managed to isolate the problem (magically really because we had about nowhere to begin) to a call
Logger.notice (...)
. So we went up to ourLogger
module, and finally narrowed it down to a callSyslog.log(...)
whereSyslog
isrequire ('modern-syslog')
.I haven't had time to properly inspect the code, but guys, somewhere you must be throwing a string as an error or something like this, because there was no stack and it killed me.
Bonus point: I stumbled on the README.md which says "Note that syslog functions cannot fail, and neither throw errors, nor callback". I have to admit I might have called you names...
Anyway, you might to take a look into that, I suspect that this happens when you call code inside the
core.cc
file, but again, not sure, I haven't had time to inspect further.