Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property '__model' of undefined #20

Open
pcsolomon opened this issue Jan 3, 2016 · 1 comment
Open

Cannot read property '__model' of undefined #20

pcsolomon opened this issue Jan 3, 2016 · 1 comment

Comments

@pcsolomon
Copy link

Following the tutorial and using the standard built-in user and authentication models, I am unable to save new or updated users. Specific error:
TypeError: Cannot read property '__model' of undefined
at Object.upsert (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/server/relational-upsert.js:44:30)
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/index.js:311:22
at Layer.handle as handle_request
at next (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/route.js:100:13)
at Route.dispatch (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/route.js:81:3)
at Layer.handle as handle_request
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:234:24
at Function.proto.process_params (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:312:12)
at /Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:228:12
at Function.match_layer (/Users/pcs/loopback-cms/node_modules/isbx-loopback-cms/node_modules/express/lib/router/index.js:295:3)

I have tried with both in-memory and a Postgres connected database.

It is worth noting that my common > models directory is empty given I haven't extended the built-in models (yet). The examples extend User as Account.

Should this work as is, or do I need to have .js and .json files in the model directory?
Can you supply a more complete example to download and compare?

@coolwr
Copy link
Contributor

coolwr commented Jan 4, 2016

Yes, you should extend the models in common/models.

We've been planning on releasing a complete CMS example for reference. It's still the early stages on this project. Thanks.

dan-h-ch pushed a commit to dan-h-ch/isbx-loopback-cms that referenced this issue Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants