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

Crashing after upgrade to newest node 12.6 #3168

Closed
ignasg opened this issue Jul 16, 2015 · 0 comments
Closed

Crashing after upgrade to newest node 12.6 #3168

ignasg opened this issue Jul 16, 2015 · 0 comments

Comments

@ignasg
Copy link

ignasg commented Jul 16, 2015

So I did node upgrade from 10.x and upgraded all packages, then started getting this error when saving a simple document on aws server.

{ aerospace: 'on', [__proto__]: {} }
error: [C:\Web\OldWeb\server.js] 2015-07-16 14:20 reference: 2f1faa1c0a ip: ::ff
ff:94.13.146.206
TypeError: Cannot read property 'ref' of undefined
    at model.Document.set (C:\Web\OldWeb\node_modules\mongoose\lib\document.js:4
49:74)
    at model.Document (C:\Web\OldWeb\node_modules\mongoose\lib\document.js:60:10
)
    at model.Model (C:\Web\OldWeb\node_modules\mongoose\lib\model.js:43:12)
    at new model (C:\Web\OldWeb\node_modules\mongoose\lib\model.js:2491:11)
    at C:\Web\OldWeb\structure\routes\resources\profile.js:502:64
    at C:\Web\OldWeb\node_modules\async\lib\async.js:251:17
    at C:\Web\OldWeb\node_modules\async\lib\async.js:154:25
    at C:\Web\OldWeb\node_modules\async\lib\async.js:248:21
    at C:\Web\OldWeb\node_modules\async\lib\async.js:612:34
    at async.series.user (C:\Web\OldWeb\structure\routes\resources\profile.js:32
4:21)

on this line:

&& !(this.schema.paths[key] && this.schema.paths[key].options.ref)

changing the last bit to something like:

this.schema.paths[key].options?this.schema.paths[key].options.ref:false)

seems to sort it out. Would you like a PR?

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