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

Method Map.prototype.has called on incompatible receiver #59

Open
Hyperblaster opened this issue Jun 27, 2018 · 8 comments
Open

Method Map.prototype.has called on incompatible receiver #59

Hyperblaster opened this issue Jun 27, 2018 · 8 comments

Comments

@Hyperblaster
Copy link

Just Updated mongoose from 5.0.16 to 5.1.7 and now encounter this error.
Rolling back to 5.0.16, everything works fine. Is mongoose-schema-extend not valid with the later versions of mongoose?

TypeError: Method Map.prototype.has called on incompatible receiver [object Map]
    at Clone.has (<anonymous>)
    at get (/node_modules/kareem/index.js:418:11)
    at Clone.Kareem.pre (/node_modules/kareem/index.js:350:16)
    at Clone.Schema.pre (/node_modules/mongoose/lib/schema.js:1135:20)
    at Schema.extend (/node_modules/mongoose-schema-extend/index.js:92:15)
@techitesh
Copy link

Facing Same issue on mongoose version "^5.1.7" any solution???

@kennylmay
Copy link

I also face the same problem. I have narrowed it down to 5.1.4 of mongoose works to 5.1.5 doesn't.

@techitesh
Copy link

I created By Own Plugin and Resolved the Issue

@bdsomer
Copy link

bdsomer commented Aug 1, 2018

@techitesh Could you please explain your solution?

@kennylmay
Copy link

@bdsomer I forked it and fixed this problem I believe. Give it a try and see if it works for you https://github.com/kennylmay/mongoose-schema-extend

@bdsomer
Copy link

bdsomer commented Aug 3, 2018

@kennylmay I would make a PR to this repo! I know the developers aren't active but just in case they come back.

@dsc8x
Copy link

dsc8x commented Aug 19, 2018

@Hyperblaster note that you actually don't really need this lib anymore, as this is now built into mongoose: https://mongoosejs.com/docs/api.html#model_Model.discriminator

@Hyperblaster
Copy link
Author

@epegzz Know of an upgrade tutorial at all out there?

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

5 participants