{"record":{"id":"46b06630bd62e59b","repo":"medusajs/medusa","slug":"fields-property-at-the-j-index-of-the-forms","errorCode":null,"errorMessage":"'fields' property at the ${j} index of the 'forms' property is malformed. The 'fields' property must be an object.","messagePattern":"'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":584,"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        `'fields' property is missing from the ${j} entry in the 'forms' property in ${file}.`,\n        { file }\n      )\n      return\n    }\n\n    const fields: CustomFieldConfigField[] = []\n\n    if (!isObjectExpression(fieldsObject.value)) {\n      logger.warn(\n        `'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":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L566-L602","documentation":"The getConfig equivalent of the fields-shape check: fieldsObject.value must be an ObjectExpression. Arrays, identifiers, calls, or any other node type cause this warning and the entry is skipped.","triggerScenarios":"fields: [ ... ] array syntax, fields: importedFields variable, or fields: buildFields().","commonSituations":"Assuming an array like 'forms', or attempting to share/reuse field maps via imports (not possible with static analysis).","solutions":["Make 'fields' an inline object literal keyed by field name","Inline any imported map","Remove helper-call indirection"],"exampleFix":"// before\nforms: [{ zone: 'general', fields: sharedFields }]\n// after\nforms: [{ zone: 'general', fields: { myField: { ... } } }]","handlingStrategy":"type-guard","validationCode":"if (Array.isArray(f.fields) || typeof f.fields !== 'object') {\n  throw new Error('fields must be an inline object literal')\n}","typeGuard":"const isFieldsObject = (v: unknown): v is Record<string, unknown> =>\n  typeof v === 'object' && v !== null && !Array.isArray(v)","tryCatchPattern":null,"preventionTips":["Write fields inline; only 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"}