You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LoopBack happily ignores relations property and creates a User model without relations. The problem manifests with a mysterious crash of the application much later:
server/node_modules/loopback/lib/models/user.js:160
user.accessTokens.create({
^
TypeError: Cannot call method 'create' of undefined
at server/node_modules/loopback/lib/models/user.js:160:29
at server/node_modules/loopback/lib/models/user.js:224:7
at server/node_modules/loopback/node_modules/bcryptjs/bcrypt.min.js:40:101
[cut]
Proposal
app.model and app.dataSource should throw an error when the configuration contains unknown properties.
Activity
ritch commentedon Feb 5, 2014
Your proposal sounds good. Configs should be validated in the workspace as well.
bajtos commentedon Oct 15, 2014
FWIW, the example above no longer crashes, because all options can be defined on the top level too.
Adding a custom option is a valid usage, e.g. connectors use that for database-specific configuration.
I am closing this issue as no longer relevant.