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.

Field Level Validation Validator is not a function

See original GitHub issue

Hi, I have a simple signup form component and Im trying to use field level validation on each field. Everytime I pass validate prop on any field, I get this weird error. I’m using next js for server-rendering.

TypeError: validator is not a function
    at getError (http://localhost:3000/_next/-/commons.js:25486:19)
    at http://localhost:3000/_next/-/commons.js:25513:19
    at Array.forEach (native)
    at http://localhost:3000/_next/-/commons.js:25511:29
    at Form.validateIfNeeded (http://localhost:3000/_next/-/commons.js:26490:213)
    at Form.componentWillReceiveProps (http://localhost:3000/_next/-/commons.js:26558:18)
    at http://localhost:3000/_next/-/main.js:19132:23
    at measureLifeCyclePerf (http://localhost:3000/_next/-/main.js:18596:12)
    at ReactCompositeComponentWrapper.updateComponent (http://localhost:3000/_next/-/main.js:19131:9)**

If I remove the validate prop. the page renders as expected.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
atalebaghacommented, Feb 9, 2017

I’m getting the same error @khpatel4991 could you share the details of your error so maybe it can help me fix the error

0reactions
lock[bot]commented, Jun 1, 2018

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

Field Level Validation Validator is not a function #2515 - GitHub
Hi, I have a simple signup form component and Im trying to use field level validation on each field. Everytime I pass validate...
Read more >
redux-form field validation level does not accept functions in ...
1 Answer 1 ... Yes, basically you need to create the validation function outside of your render() method because every time the form...
Read more >
Validation - Formik
Form-level validation is useful because you have complete access to all of your form's values and props whenever the function runs, so you...
Read more >
Validate - Go Packages
Package validator implements value validations for structs and individual fields based on tags.
Read more >
Field-Level Validation Example - Redux Form
If the value is invalid, the validation function should return an error. This is usually a string, but it does not have to...
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