Cannot read property 'apply' of undefined
See original GitHub issueSuddenly after re installed npm dependency. Using custom validator throws the “Cannot read property ‘apply’ of undefined”
Custom validation rule :
app.use(expressValidator({
customValidators: {
isObject: function (value) {
return ObjectId.isValid(value);
}
}
}));
Schema for validation
var schema = {
'_vehicle': {
notEmpty: true,
isObject: {
errorMessage: 'Vehicle type is should object'
},
errorMessage: 'Vehicle type is required'
},
'_maker': {
notEmpty: true,
isObject: {
errorMessage: 'Maker is should object'
},
errorMessage: 'Maker type is required'
},
'status': {
notEmpty: true,
errorMessage: 'Status is required'
}
};
kindly help me Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Cannot read property 'apply' of undefined · Issue #2359
So I am building a website. When I use a regular browser like google chrome everything works as expected, then I used blisk...
Read more >Redux TypeError: Cannot read property 'apply' of undefined
For the undefined cases, it will run (f => f).apply which executes successfully. But this is more of fooling the compose method and...
Read more >Error message "Cannot read property 'apply' of undefined"
When the UI Action is script is executed, this error is shown in the browser console: Uncaught TypeError: Cannot read property 'apply' of...
Read more >Uncaught TypeError: Cannot read property 'apply' of ...
When trying to change theme component setting, clicking the green check button produces the following error, changes are not saved (Category icons component ......
Read more >Cannot read property 'apply' of undefined" - Forums
RE: Cannot read property 'apply' of undefined" (Answer) ... The hover method takes 2 parameters, one for mouse over and one for mouse...
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
Ah, cool, I checked it out 😃
You’re setting the custom validator to an unused express app, but the routes that use the custom validator are set in the exported express router.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.