{"record":{"id":"3c001d70a9b76ec4","repo":"medusajs/medusa","slug":"the-fields-property-at-the-j-index-of-the-fo","errorCode":null,"errorMessage":"The 'fields' property at the ${j} index of the 'forms' property is malformed. The 'fields' property must be an object.","messagePattern":"The 'fields' property at the (.+?) index of the 'forms' property is malformed\\. The 'fields' property must be an object\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts","lineNumber":364,"sourceCode":"      return\n    }\n\n    const fieldsObject = element.properties.find(\n      (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"fields\" })\n    ) as ObjectProperty | undefined\n\n    if (!fieldsObject) {\n      logger.warn(\n        `The 'fields' property is missing at the ${j} index of the 'forms' property. The 'fields' property is required to load a custom field form.`,\n        { file }\n      )\n      return\n    }\n\n    const fields: CustomFieldFormField[] = []\n\n    if (!isObjectExpression(fieldsObject.value)) {\n      logger.warn(\n        `The 'fields' property at the ${j} index of the 'forms' property is malformed. The 'fields' property must be an object.`,\n        { file }\n      )\n      return\n    }\n\n    fieldsObject.value.properties.forEach((field) => {\n      if (!isObjectProperty(field) || !isIdentifier(field.key)) {\n        return\n      }\n\n      const name = field.key.name\n\n      if (\n        !isObjectExpression(field.value) &&\n        !(\n          isCallExpression(field.value) &&\n          isMemberExpression(field.value.callee) &&","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L346-L382","documentation":"The 'fields' property of a form entry must be a plain object expression mapping field names to definitions. If the AST value is an array, identifier, call, or anything other than an ObjectExpression, this warning is emitted and the entry is skipped.","triggerScenarios":"fields: [field1, field2], fields: myFields (imported variable), or fields: getFields().","commonSituations":"Assuming fields is a list like the outer 'forms' array, or trying to DRY configs by extracting the fields object to a variable (unsupported because parsing is static).","solutions":["Change 'fields' to an inline object literal keyed by field name","Inline imported/constant field definitions directly into the config","Use form.define({...}) per field key if defining component-backed fields"],"exampleFix":"// before\nforms: [{ zone: 'general', fields: [myFieldDef] }]\n// after\nforms: [{ zone: 'general', fields: { myField: form.define({ ... }) } }]","handlingStrategy":"type-guard","validationCode":"if (Array.isArray(f.fields) || typeof f.fields !== 'object') {\n  throw new Error('fields must be a plain object, not an array')\n}","typeGuard":"const isPlainObject = (v: unknown): v is Record<string, unknown> =>\n  typeof v === 'object' && v !== null && !Array.isArray(v)","tryCatchPattern":null,"preventionTips":["Remember the shape: forms is an array of { zone, fields: { name: def } }; only the outer forms is an array"],"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"}