SyntaxFix
Write A Post
Hire A Developer
Questions
For me, this was an issue with cyclic dependencies.
IOW, module A required module B, and module B required module A.
So in module B, require('./A') is an empty object rather than a function.
require('./A')
How to deal with cyclic dependencies in Node.js