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.

Cannot read property 'apply' of undefined

See original GitHub issue

Suddenly 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:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gustavohenkecommented, Apr 30, 2017
0reactions
lock[bot]commented, Jun 2, 2019

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.

Read more comments on GitHub >

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

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