mongoose 4.0.1 Error: "Cannot read property 'prototype' of undefined"
See original GitHub issueFlow the prompt to check the lib/plugin.js, then there is the code
if (mongoose.Query.prototype.deepPopulate == null) {
patchMongooseQuery(mongoose)
}
but, as if there is no mongoose.Query object in mongoose 4.0.1(may be 4.x.x), so it throw error: “Cannot read property ‘prototype’ of undefined”–as the code, mongoose.Query not be checked if it is null。but the version @1.1.0 is work for mongoose 4.x.x, may be because the dependence is mongoose@>=3.6.0, but @2.0.0 the is depend on mongoose@>4.0.0 so, wish it is help, and expect to fix it , mongoose-deep-populate is awesome work~
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Cannot read property 'prototype' of undefined · Issue #7173 ...
I just import mongoose in a project that initialized by vue-cli ... Uncaught TypeError: Cannot read property 'prototype' of undefined #7173.
Read more >Node.js "Cannot read property 'prototype' of undefined" error
This compilation error because of versions conflicts of npm and node. I had the same issue in my project. I resolved after install...
Read more >Getting "Uncaught TypeError: Cannot read property 'prototype ...
Getting "Uncaught TypeError: Cannot read property 'prototype' of undefined" from Drupal.Ajax which is bringing down the rest of the sites JS ...
Read more >cannot read properties of undefined (reading 'create') node js
Here's an example of a JavaScript TypeError: Cannot read property of undefined thrown when a property is attempted to be read on an...
Read more >Cannot read property 'prototype' of undefined, request.js 31 ...
Coding example for the question Express - Uncaught TypeError: Cannot read property 'prototype' of undefined, request.js 31-node.js.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Did you load mongoose-deep-populate correctly per 2.0 breaking change? That is:
Agreed. I’ll highlight that.