medusajs/medusa · warning

'zone' property at the ${j} index of the 'forms' property ca

Error message

'zone' property at the ${j} index of the 'forms' property cannot be a template literal (e.g. `general`).

What it means

The plugin rejects template literals for 'zone' even though they look like strings, because it requires a StringLiteral AST node for static resolution. If zoneProperty.value is a TemplateLiteral, this warning is emitted and the entry is skipped.

Source

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

        { file }
      )
      return
    }

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

    if (!zoneProperty) {
      logger.warn(
        `'zone' property is missing from the ${j} index of the 'forms' property.`,
        { file }
      )
      return
    }

    if (isTemplateLiteral(zoneProperty.value)) {
      logger.warn(
        `'zone' property at the ${j} index of the 'forms' property cannot be a template literal (e.g. \`general\`).`,
        { file }
      )
      return
    }

    if (!isStringLiteral(zoneProperty.value)) {
      logger.warn(
        `'zone' property at the ${j} index of the 'forms' property is not a string literal (e.g. 'general' or 'attributes').`,
        { file }
      )
      return
    }

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

    if (

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Change backticks to single or double quotes: zone: 'general'
  2. Disable template-literal formatting for these config files if a tool is rewriting them

Example fix

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

Strategy: type-guard

Validate before calling

// static check: source must use quotes, not backticks
// runtime sanity:
if (typeof f.zone !== 'string') throw new Error('zone must be a plain string')

Type guard

const isQuotedString = (v: unknown): v is string => typeof v === 'string' && !v.includes('${')

Prevention

When it happens

Trigger: zone: `general` with backticks instead of quotes.

Common situations: Prettier/editor auto-converting quotes to backticks, or developers using template literals by habit; the dedicated message exists because `general` superficially looks valid.

Related errors


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