Friday 17 November 2017

Strange TypeError when calling a function in Node.js

I have a library named lib and a function in it called getInfo. I have another library called util. A function in lib calls a function in util, which calls lib.getInfo() , and when it runs I get "TypeError: _lib2.default.getInfo is not a function". I clearly call lib.getInfo() in my file, and I am wondering why I get this error. I have unit tested getInfo using chai and it executes properly. My only thought is that I should not be calling functions back and forth like this. I tried searching on stackoverflow and google, but I am at a loss.

Submitted November 17, 2017 at 09:12PM by 302prime

No comments:

Post a Comment