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

TypeError: Cannot read property 'paths' of undefined #83

Open
Caruso33 opened this issue Jun 16, 2018 · 0 comments
Open

TypeError: Cannot read property 'paths' of undefined #83

Caruso33 opened this issue Jun 16, 2018 · 0 comments

Comments

@Caruso33
Copy link

Object.generateTempUserModel (node_modules/email-verification/index.js:172:29) runs into problems:

(node_modules/email-verification/index.js:172
 Object.keys(User.schema.paths).forEach(function(field) {

TypeError: Cannot read property 'paths' of undefined

I use node-email-verification for the first time and just updated all npm packages, hence my mongoose version is 5.1.5 which might break the index.js file.

I see that the User model from mongoose now returns User.User.schema....not User.schema.
If that is changed on several places, however, the next thing is the callback function:

node_modules/email-verification/index.js:221
return callback(null, mongoose.model(options.tempUserCollection));
^

TypeError: callback is not a function
at Object.generateTempUserModel (node_modules/email-verification/index.js:221:12)

Any ideas how to fix this?

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

1 participant