medusajs/medusa · warning

'fields' property is missing from the ${j} entry in the 'for

Error message

'fields' property is missing from the ${j} entry in the 'forms' property in ${file}.

What it means

In the getConfig flow, every 'forms' entry must include a 'fields' object. When the entry at index j has no fields key, the plugin warns (including the source file) and skips the entry, since there is nothing to generate configuration for.

Source

Thrown at packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts:574

    const zone = zoneProperty.value.value
    const fullPath = getFormEntryConfigPath(model, zone)

    if (
      !isValidCustomFieldFormZone(zone) ||
      !isValidCustomFieldFormConfigPath(fullPath)
    ) {
      logger.warn(
        `'zone' property at the ${j} index of the 'forms' property is not a valid custom field form zone for the '${model}' model. Received: ${zone}.`
      )
      return
    }

    const fieldsObject = element.properties.find(
      (p) => isObjectProperty(p) && isIdentifier(p.key, { name: "fields" })
    ) as ObjectProperty | undefined

    if (!fieldsObject) {
      logger.warn(
        `'fields' property is missing from the ${j} entry in the 'forms' property in ${file}.`,
        { file }
      )
      return
    }

    const fields: CustomFieldConfigField[] = []

    if (!isObjectExpression(fieldsObject.value)) {
      logger.warn(
        `'fields' property at the ${j} index of the 'forms' property is malformed. The 'fields' property must be an object.`,
        { file }
      )
      return
    }

    fieldsObject.value.properties.forEach((field) => {
      if (!isObjectProperty(field) || !isIdentifier(field.key)) {

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Add fields: { ... } as a sibling of zone/tab in the entry
  2. Check the spelling and case of the property name
  3. Ensure fields is not accidentally nested inside another property

Example fix

// before
forms: [{ zone: 'general', tab: 'general' }]
// after
forms: [{ zone: 'general', tab: 'general', fields: { myField: { ... } } }]
Defensive patterns

Strategy: validation

Validate before calling

forms.forEach((f, i) => {
  if (!f.fields || typeof f.fields !== 'object') {
    throw new Error(`forms[${i}] is missing a fields object`)
  }
})

Type guard

const hasFieldsKey = (f: unknown): f is { fields: object } =>
  typeof f === 'object' && f !== null && 'fields' in (f as object)

Prevention

When it happens

Trigger: forms: [{ zone: 'general' }] with no fields, or the key misspelled as 'Fields'/'field'.

Common situations: Template configs left half-finished, refactors renaming the key, or merging configs that dropped fields.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/3e69519048cb5197. Report an issue: GitHub.