The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jasonc (12) [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.
331872 (131) [Avatar] Offline
#2
Thanks for catching this! We'll make a note