Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

error #2

Open
baturorkun opened this issue Mar 15, 2018 · 2 comments
Open

error #2

baturorkun opened this issue Mar 15, 2018 · 2 comments

Comments

@baturorkun
Copy link

hello
i have an error:

Fetching latest app status...
util.js:1084
throw new errors.TypeError(
^

TypeError [ERR_INVALID_ARG_TYPE]: The "last argument" argument must be of type function
at implementation (util.js:1084:13)
at WebClient.apiCall (/root/itunes-connect-slack/node_modules/@slack/client/dist/WebClient.js:384:47)
at Object.postToSlack [as slack] (/root/itunes-connect-slack/post-update.js:21:14)
at /root/itunes-connect-slack/poll-itc.js:22:15
at ChildProcess.exithandler (child_process.js:267:7)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

@erikvillegas
Copy link
Owner

Hi, I think the Slack dependency was updated with breaking changes. While I fix it, try installing this slightly outdated version:

npm install @slack/[email protected] --save

@baturorkun
Copy link
Author

hi erik
i found the problem. Slack api was changed. Second parameter of "client.chat.postMessage" function must be "callback" function. I changed it like this
// batur
var params = {
"channel": "dev_team",
"attachments" : [attachment],
"as_user" : "false"
}

client.chat.postMessage(params, function(err, res) {
    if (err) {
        console.log('Error:', err);
    }
});

Meanwhile, there are extra extra important a few small changes to run the code.

thanks

erikvillegas pushed a commit that referenced this issue Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants