I'm trying to upload a zipped action to IBM's OpenWhisk.
"Initialization has failed due to: Action entrypoint 'main' is not a function."
But I'm quite sure that "main" is a function, and I've tried defining it in multiple ways. As tutorials suggest, I've tried both:
function processComment(params) {
// some code
return {success:1};
}
exports.main = processComment;
and
function main(params) {
// some code
return {success:1};
}
This code is all contained in a file is called index.js, and I've tried it with and without the following line in my package.json:
"main": "index.js",
I even looked up the relevant code in OpenWhisk, and it seems to be a straightforward type check to see if main is a function:
if (typeof thisRunner.userScriptMain !== 'function') {
throw "Action entrypoint '" + message.main + "' is not a function.";
}
So I assume it's just not finding "main" in the right place... But I'm really lost. Can somebody help me out?