{"record":{"id":"296c9def9af81f61","repo":"medusajs/medusa","slug":"forms-property-at-the-j-index-is-malformed-t","errorCode":null,"errorMessage":"'forms' property at the ${j} index is malformed. The 'forms' property must be an object.","messagePattern":"'forms' property at the (.+?) index is malformed\\. The 'forms' 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":521,"sourceCode":"\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\n    if (!zoneProperty) {\n      logger.warn(\n        `'zone' property is missing from the ${j} index of the 'forms' property.`,\n        { file }\n      )\n      return\n    }\n","sourceCodeStart":503,"sourceCodeEnd":539,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L503-L539","documentation":"The 'forms' array was found, but the element at index j is not a plain object expression (it could be a string, variable, spread, or null hole). The plugin requires every entry to be an object literal and skips non-object entries with this warning.","triggerScenarios":"forms: ['general'], forms: [...otherForms] (spread), or a trailing comma creating a hole.","commonSituations":"Assuming forms takes strings or paths, trying to spread shared form arrays, or copy-paste mistakes inside the array.","solutions":["Wrap each entry in an object literal: { zone: '...', fields: { ... } }","Remove spreads; inline every form entry","Delete stray values or holes in the array"],"exampleFix":"// before\nforms: ['general', { zone: 'general', fields: { ...} }]\n// after\nforms: [{ zone: 'general', fields: { ... } }]","handlingStrategy":"type-guard","validationCode":"forms.forEach((f, i) => {\n  if (typeof f !== 'object' || f === null || Array.isArray(f)) {\n    throw new Error(`forms[${i}] must be an object literal`)\n  }\n})","typeGuard":"const isFormObject = (v: unknown): v is Record<string, unknown> =>\n  typeof v === 'object' && v !== null && !Array.isArray(v)","tryCatchPattern":null,"preventionTips":["Do not spread other arrays into forms; write every entry literally"],"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"}