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

error received: TypeError: fn.apply is not a function #132

Closed
tamaker opened this issue Jul 29, 2016 · 5 comments · Fixed by #138
Closed

error received: TypeError: fn.apply is not a function #132

tamaker opened this issue Jul 29, 2016 · 5 comments · Fixed by #138

Comments

@tamaker
Copy link

tamaker commented Jul 29, 2016

Im using the following and consistently get the error:

TypeError: fn.apply is not a function
    at /usr/local/lib/node_modules/node-notifier/lib/utils.js:175:8
    at /usr/local/lib/node_modules/node-notifier/lib/utils.js:55:5
    at ChildProcess.exithandler (child_process.js:198:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)

code I'm using that DOES successfully fire a notification on OSX:

var notifier = require('/usr/local/lib/node_modules/node-notifier');
// String 
notifier.notify('Message');

// Object 
notifier.notify({
    'title': 'My notification',
    'message': 'Hello, there!'
}, 2000);

immediately after the notification appears, the node.js http server instance crashes.

Im running node v6.2.2 on OSX 10.10.4

@positlabs
Copy link

What code are you running that fails?

@mikaelbr
Copy link
Owner

mikaelbr commented Sep 6, 2016

The problem here is the second argument when doing:

// Object 
notifier.notify({
    'title': 'My notification',
    'message': 'Hello, there!'
}, 2000);

See the documentation, the second argument is a callback function, not a time delay.

Passing something other than a function here will cause a error. This probably should throw a typeerror with a descriptive text which says something like second argument being a callback and it should be a optional function.

@schenkfab
Copy link

Hi @mikaelbr . I would like to give this a try.

@mikaelbr
Copy link
Owner

mikaelbr commented Sep 6, 2016

Perfect! Just let me know if you need any help getting started.

@mikaelbr mikaelbr removed their assignment Sep 6, 2016
@schenkfab
Copy link

Thank you! I'll let you know if everything fails 👍

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

Successfully merging a pull request may close this issue.

5 participants