MissingSchemaError: Schema hasn’t been registered for model “User”
In my models/user.js file: And in my router/index.js, I have: which throws the error: If however, in user.js, I do (in the last line) and in index.js I do var User = require(‘../models/User’);, then everything works. But it should not, because in config/pass.js I am doing var User = mongoose.model(‘User’); and it’s working flawlessly. The … Read more