question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mongoose 4.0.1 Error: "Cannot read property 'prototype' of undefined"

See original GitHub issue

Flow 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:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
buunguyencommented, Aug 20, 2015

Did you load mongoose-deep-populate correctly per 2.0 breaking change? That is:

var deepPopulate = require('mongoose-deep-populate')(mongoose)
0reactions
buunguyencommented, Aug 20, 2015

Agreed. I’ll highlight that.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found