{"record":{"id":"81537fe3a2874edc","repo":"medusajs/medusa","slug":"zone-property-at-the-j-index-of-the-forms-p-81537f","errorCode":null,"errorMessage":"'zone' property at the ${j} index of the 'forms' property is not a string literal (e.g. 'general' or 'attributes').","messagePattern":"'zone' property at the (.+?) index of the 'forms' property is not a string literal \\(e\\.g\\. 'general' or 'attributes'\\)\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts","lineNumber":549,"sourceCode":"\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\n    if (isTemplateLiteral(zoneProperty.value)) {\n      logger.warn(\n        `'zone' property at the ${j} index of the 'forms' property cannot be a template literal (e.g. \\`general\\`).`,\n        { file }\n      )\n      return\n    }\n\n    if (!isStringLiteral(zoneProperty.value)) {\n      logger.warn(\n        `'zone' property at the ${j} index of the 'forms' property is not a string literal (e.g. 'general' or 'attributes').`,\n        { file }\n      )\n      return\n    }\n\n    const zone = zoneProperty.value.value\n    const fullPath = getFormEntryConfigPath(model, zone)\n\n    if (\n      !isValidCustomFieldFormZone(zone) ||\n      !isValidCustomFieldFormConfigPath(fullPath)\n    ) {\n      logger.warn(\n        `'zone' property at the ${j} index of the 'forms' property is not a valid custom field form zone for the '${model}' model. Received: ${zone}.`\n      )\n      return\n    }","sourceCodeStart":531,"sourceCodeEnd":567,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L531-L567","documentation":"The 'zone' value must be a plain string literal; identifiers, expressions, template literals (covered by the previous check), and other node types all fail this final isStringLiteral check in the getConfig flow, producing this warning and skipping the entry.","triggerScenarios":"zone: ZONES.general, zone: 'gen' + 'eral', or zone: getZone().","commonSituations":"Centralizing zone names in an enum/constant object, or building configs with helper functions.","solutions":["Inline the literal: zone: 'general'","Duplicate the literal string per entry instead of referencing constants","Keep config files fully static"],"exampleFix":"// before\nforms: [{ zone: ZONES.general, fields: { ... } }]\n// after\nforms: [{ zone: 'general', fields: { ... } }]","handlingStrategy":"validation","validationCode":"forms.forEach((f, i) => {\n  if (typeof f.zone !== 'string') throw new Error(`forms[${i}].zone must be an inline string literal`)\n})","typeGuard":"const isLiteralString = (v: unknown): v is string => typeof v === 'string'","tryCatchPattern":null,"preventionTips":["Inline zone strings; the plugin cannot see constants","Add a lint rule banning member expressions for zone (e.g. ZONES.general)"],"tags":["admin","custom-fields","string-literal","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"}