{"record":{"id":"e9fa2d51d3e3a328","repo":"medusajs/medusa","slug":"forms-property-is-missing","errorCode":null,"errorMessage":"'forms' property is missing.","messagePattern":"'forms' property is missing\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts","lineNumber":513,"sourceCode":"\nfunction getFormEntryFieldPath(\n  model: CustomFieldModel,\n  zone: string,\n  tab?: string\n): string {\n  return `${model}.${zone}.${tab ? `${tab}.` : \"\"}$field`\n}\n\nfunction getConfigs(\n  path: NodePath<ExportDefaultDeclaration>,\n  model: CustomFieldModel,\n  index: number,\n  file: string\n): CustomFieldConfig[] | null {\n  const formArray = getFormsArgument(path, file)\n\n  if (!formArray) {\n    logger.warn(`'forms' property is missing.`, { file })\n    return null\n  }\n\n  const configs: CustomFieldConfig[] = []\n\n  formArray.elements.forEach((element, j) => {\n    if (!isObjectExpression(element)) {\n      logger.warn(\n        `'forms' property at the ${j} index is malformed. The 'forms' property must be an object.`,\n        { file }\n      )\n      return\n    }\n\n    const zoneProperty = element.properties.find(\n      (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"zone\" })\n    ) as ObjectProperty | undefined\n","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L495-L531","documentation":"For custom-field form configs (the getFormConfig flow), the plugin looks for the 'forms' argument in the admin plugin call. If it is absent entirely (getFormsArgument returns null), this warning is logged and no configs are generated for that file.","triggerScenarios":"Exporting a module from the admin custom-fields directory that never calls the plugin with a forms property, or misspelling 'forms' as 'Forms'/'form'.","commonSituations":"Adding a barrel/index file under src/admin, starting a config file from an empty template, or a typo in the property name.","solutions":["Add a forms: [...] array to the plugin/config call in the file indicated by {file}","Check the property is spelled exactly 'forms'","Remove the file from the custom-fields source directory if it is not meant to be a form config"],"exampleFix":"// before\nexport default defineConfig({})\n// after\nexport default defineConfig({\n  forms: [{ zone: 'general', tab: 'general', fields: { ... } }],\n})","handlingStrategy":"validation","validationCode":"if (!config.forms) throw new Error(\"config file must export a 'forms' array\")","typeGuard":"const hasForms = (c: unknown): c is { forms: unknown[] } =>\n  typeof c === 'object' && c !== null && 'forms' in (c as object)","tryCatchPattern":null,"preventionTips":["Start from a working example config in src/admin rather than a blank file","Keep non-config files out of the custom-fields source directory"],"tags":["admin","custom-fields","config-validation"],"backgroundTag":"admin-custom-field-form-validation","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}