{"record":{"id":"8c0f2bea06e2f13f","repo":"Meituan-Dianping/mpvue","slug":"missing-required-prop-name","errorCode":null,"errorMessage":"Missing required prop: \"${name}\"","messagePattern":"Missing required prop: \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/util/props.js","lineNumber":97,"sourceCode":"  // call factory function for non-Function types\n  // a value is Function if its prototype is function even across different execution context\n  return typeof def === 'function' && getType(prop.type) !== 'Function'\n    ? def.call(vm)\n    : def\n}\n\n/**\n * Assert whether a prop is valid.\n */\nfunction assertProp (\n  prop: PropOptions,\n  name: string,\n  value: any,\n  vm: ?Component,\n  absent: boolean\n) {\n  if (prop.required && absent) {\n    warn(\n      'Missing required prop: \"' + name + '\"',\n      vm\n    )\n    return\n  }\n  if (value == null && !prop.required) {\n    return\n  }\n  let type = prop.type\n  let valid = !type || type === true\n  const expectedTypes = []\n  if (type) {\n    if (!Array.isArray(type)) {\n      type = [type]\n    }\n    for (let i = 0; i < type.length && !valid; i++) {\n      const assertedType = assertType(value, type[i])\n      expectedTypes.push(assertedType.expectedType || '')","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/util/props.js#L79-L115","documentation":"Emitted by assertProp (called from validateProp during props initialization) when the prop is marked required: true and the 'absent' flag is set — the parent did not pass the prop and no default exists to fill in (required props ignore defaults in practice, and absence means the key was entirely missing from propsData). Initialization continues with the value undefined, so downstream code reading the prop likely breaks at runtime.","triggerScenarios":"Thrown at src/core/util/props.js:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the prop from the parent: <my-comp :item-id=\"id\" />","If the prop is actually optional, drop required: true and provide a default instead","Check prop name casing: kebab-case in templates (:item-id) vs camelCase declaration (itemId) — a mismatch makes the prop appear absent","In tests, supply the prop via propsData or the mounting options"],"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"}