{"record":{"id":"586fe895d8945f21","repo":"medusajs/medusa","slug":"the-forms-property-is-malformed-the-forms-pro","errorCode":null,"errorMessage":"The 'forms' property is malformed. The 'forms' property must be an array of objects.","messagePattern":"The 'forms' property is malformed\\. The 'forms' property must be an array of objects\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts","lineNumber":700,"sourceCode":"  path: NodePath<ExportDefaultDeclaration>,\n  file: string\n): ArrayExpression | null {\n  const configArgument = getConfigArgument(path)\n\n  if (!configArgument) {\n    return null\n  }\n\n  const formProperty = configArgument.properties.find(\n    (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"forms\" })\n  ) as ObjectProperty | undefined\n\n  if (!formProperty) {\n    return null\n  }\n\n  if (!isArrayExpression(formProperty.value)) {\n    logger.warn(\n      `The 'forms' property is malformed. The 'forms' property must be an array of objects.`,\n      { file }\n    )\n    return null\n  }\n\n  return formProperty.value\n}\n","sourceCodeStart":682,"sourceCodeEnd":709,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L682-L709","documentation":"This is the getFormsArgument check: when a 'forms' property exists on the plugin/config call but its value is not an array expression, the plugin warns that forms must be an array of objects and returns null so no configs are generated for the file.","triggerScenarios":"forms: { zone: 'general', ... } (single object instead of array), forms: getForms(), or forms: someConstant.","commonSituations":"Wrapping a single form in an object because there is only one, or assigning a computed/imported value.","solutions":["Wrap entries in an array: forms: [{ zone: 'general', fields: { ... } }]","Inline the array literal rather than computing it","Verify every element is an object literal"],"exampleFix":"// before\nforms: { zone: 'general', fields: { ... } }\n// after\nforms: [{ zone: 'general', fields: { ... } }]","handlingStrategy":"type-guard","validationCode":"if (!Array.isArray(config.forms)) {\n  throw new Error('forms must be an array of form entry objects')\n}","typeGuard":"const isFormsArray = (v: unknown): v is unknown[] => Array.isArray(v)","tryCatchPattern":null,"preventionTips":["Always bracket form entries, even for a single form","Keep the forms value as a literal array in the config file"],"tags":["admin","custom-fields","config-validation","ast-parsing"],"backgroundTag":"admin-custom-field-form-validation","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}