you might get this error if you use the same model in different files but your
require path has an other case.
For example, in my situation I had
require('./models/User') in one file, and then in another file where I needed access to the User model, I had
I guess the lookup for modules & mongoose is treating it as a different file. Once I made sure the case matched in both it was no longer an issue.