Error: message=The "last argument" argument must be of type function



  • Hi Devs,
    I am getting the below error on the latest code from github.
    Steps to reproduce -
    create a new topic.
    delete the topic.

    I should say that the forum uses postgres, so that might be related.
    Let me know should you need any more info about this issue.
    JJ.

    Error: message=The "last argument" argument must be of type function, stack=TypeError [ERR_INVALID_ARG_TYPE]: The "last argument" argument must be of type function
    at Object.deleteEvent [as method] (util.js:1050:13)
    at /nodebb/src/plugins/hooks.js:137:12
    at /nodebb/node_modules/async/dist/async.js:3110:16
    at eachOfArrayLike (/nodebb/node_modules/async/dist/async.js:1069:9)
    at eachOf (/nodebb/node_modules/async/dist/async.js:1117:5)
    at Object.eachLimit (/nodebb/node_modules/async/dist/async.js:3172:5)
    at fireActionHook (/nodebb/src/plugins/hooks.js:129:9)
    at Object.Plugins.fireHook (/nodebb/src/plugins/hooks.js:96:4)
    at /nodebb/src/posts/delete.js:45:13
    at nextTask (/nodebb/node_modules/async/dist/async.js:5324:14)
    at next (/nodebb/node_modules/async/dist/async.js:5331:9)
    at /nodebb/node_modules/async/dist/async.js:969:16
    at /nodebb/node_modules/async/dist/async.js:3888:9
    at /nodebb/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/nodebb/node_modules/async/dist/async.js:1064:13)
    at /nodebb/node_modules/async/dist/async.js:969:16, db=null


  • Admin

    The stacktrace looks like it might be happening in a plugin, which plugins do you have active?



  • Thank you so much @baris , as usual you guys are right on the money.
    I turned off @Pitaj latest calendar plugin, and the forum is back to normal. The issue seems to stem from deleteEvent.


  • Global Moderator

    @JJSagan what version of node do you have installed? Try updating to Node 10



  • Hi @PitaJ I am running on node 8.
    Is nodebb compatible with node 10?


  • Global Moderator

    Latest version of the calendar plugin is only compatible with node 10



  • OK, I'll give it a shot thanks.
    is nodebb forum safe for running with node 10?


  • Global Moderator

    Yes NodeBB works with Node 10


 

| |