jasonc (11) [Avatar] Offline
#1
I found that the code in MEAP v5 Chapter 6 didn't work for me. I would get MissingSchemaError: Schema hasn't been registered for model "Location".

I did a bit of searching and found this: https://stackoverflow.com/questions/20832126/missingschemaerror-schema-hasnt-been-registered-for-model-user

Adding require('../models/locations'); to the top of the API controllers fixed the issue if anyone else encounters this.


Nope, the problem was the
require('./app_api/models/db');
statement was after the Routers require statements in app.js. Should be before.