Build Slackbot Getting is not a constructor

I am trying to see if I could use Netlify to run my Slackbot that I use to get anime information. I have deployed the site and try to call the API and get the following stack trace. Not exactly sure where the error is happening from.

6:31:12 PM: 2020-02-27T23:31:12.139Z	undefined	
ERROR	Uncaught Exception
{
  "errorType":"TypeError",
  "errorMessage":"r(...) is not a constructor",
  "stack":[
    "TypeError: r(...) is not a constructor","    
    at Object.<anonymous> (/var/task/server.js:470:13273)","    
    at r (/var/task/server.js:1:158)","    
    at Object.<anonymous> (/var/task/server.js:309:303343)","    
    at r (/var/task/server.js:1:158)","    
    at /var/task/server.js:1:957","    
    at Object.<anonymous> (/var/task/server.js:1:968)","    
    at Module._compile (internal/modules/cjs/loader.js:955:30)","    
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)","    
    at Module.load (internal/modules/cjs/loader.js:811:32)","    
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)"
  ]
}

If I run the code locally, it all works just fine. So its something when running in netlify that is causing this to break. Thanks for any help

So this is where its bombing

class api {
  constructor(anime, req, res) {
    this.req = req;
    this.res = res;
    this.anime = anime;
    this.isMarkdown = true;
  }
}

module.exports = api;

I solved my problem as if was an add-on I was using that is causing issue

1 Like