Method Map.prototype.has called on incompatible receiver
See original GitHub issueJust 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)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Method Set.prototype.add called on incompatible receiver ...
In this case add method looses its internal this context when you pass it as a callback, so you need to use bind...
Read more >Joi import fails with Method Map.prototype.set called on ...
Test suite failed to run TypeError: Method Map.prototype.set called on incompatible receiver #<Map> at Map.set (<anonymous>) at Object.
Read more >JavaScript TypeError - X.prototype.y called on incompatible type
This JavaScript exception called on incompatible target (or object)” occurs if a function (on a given object), is called with a 'this' ...
Read more >Errors: Called on Incompatible Type - JavaScript - W3cubDocs
The JavaScript exception "called on incompatible target (or object)" occurs when a function (on a given object), is called with a this not ......
Read more >Solved: TypeError: Method Promise.prototype.then called on...
TypeError: Method Promise.prototype.then called on incompatible receiver #<DexiePromise> ... An Unexpected Error has occurred.
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 FreeTop 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
Top GitHub Comments
@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
@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