{"record":{"id":"e601a3b7c105835d","repo":"Meituan-Dianping/mpvue","slug":"invalid-prop-custom-validator-check-failed-for-pr","errorCode":null,"errorMessage":"Invalid prop: custom validator check failed for prop \"${name}\".","messagePattern":"Invalid prop: custom validator check failed for prop \"(.+?)\"\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/util/props.js","lineNumber":131,"sourceCode":"    for (let i = 0; i < type.length && !valid; i++) {\n      const assertedType = assertType(value, type[i])\n      expectedTypes.push(assertedType.expectedType || '')\n      valid = assertedType.valid\n    }\n  }\n  if (!valid) {\n    warn(\n      'Invalid prop: type check failed for prop \"' + name + '\".' +\n      ' Expected ' + expectedTypes.map(capitalize).join(', ') +\n      ', got ' + Object.prototype.toString.call(value).slice(8, -1) + '.',\n      vm\n    )\n    return\n  }\n  const validator = prop.validator\n  if (validator) {\n    if (!validator(value)) {\n      warn(\n        'Invalid prop: custom validator check failed for prop \"' + name + '\".',\n        vm\n      )\n    }\n  }\n}\n\nconst simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/\n\nfunction assertType (value: any, type: Function): {\n  valid: boolean;\n  expectedType: string;\n} {\n  let valid\n  const expectedType = getType(type)\n  if (simpleCheckRE.test(expectedType)) {\n    valid = typeof value === expectedType.toLowerCase()\n  } else if (expectedType === 'Object') {","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/util/props.js#L113-L149","documentation":"Raised at the end of assertProp when the prop's custom validator function returns a falsy value. After type checks pass, the user-supplied prop.validator(value) is invoked and must return true; returning false/undefined (including a validator that forgot its return statement) triggers this warning. It signals a value that is structurally the right type but fails the component's own business-rule constraint.","triggerScenarios":"Thrown at src/core/util/props.js:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the passed value so it satisfies the validator's rule (e.g. within an allowed list or numeric range)","Review the validator implementation — ensure every branch returns an explicit boolean and constraints match the documented API","If the constraint no longer applies, update or remove the validator from the prop definition"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}