What is the problem in this library.js?

NodeBB Development
  • I have this

    var tagsTitle = {};
    
      tagsTitle.init = function(params, callback) {
    var app = params.app;
    var controllers = params.controllers;
    callback();
    };
    
    module.exports = tagsTitle;
    

    But the console give me this error:

    "Type error: Object is not a function at Object.tagsTitle.init"

    What is the problem?

    Thanks for the help

  • What version of NodeBB are you using? if you're 0.4.x-0.5x you will need to use the older syntax

    tagsTitle.init = function(app, middleware, controllers, callback)
    

    (Or just update to 0.6x :P)

  • Thanks, problem solved, it was the nodebb version. Now I have 0.6.1


Suggested Topics


| | | |