medusajs/medusa · warning
'zone' property cannot be a template literal (e.g. `product.
Error message
'zone' property cannot be a template literal (e.g. `product.details.after`).
What it means
Zone values must be plain string literals so the plugin can statically map widgets to injection zones. Template literals cannot be statically evaluated during code generation, so extractZoneValues warns and ignores the value.
Source
Thrown at packages/admin/admin-vite-plugin/src/widgets/generate-widgets.ts:323
logger.warn(`'zone' property is missing from the widget config.`, { file })
return null
}
const validatedZones = zones.filter(isValidInjectionZone)
if (validatedZones.length === 0) {
logger.warn(`'zone' property is not a valid injection zone.`, {
file,
})
return null
}
return validatedZones
}
function extractZoneValues(value: Node, zones: string[], file: string) {
if (isTemplateLiteral(value)) {
logger.warn(
`'zone' property cannot be a template literal (e.g. \`product.details.after\`).`,
{ file }
)
return
}
if (isStringLiteral(value)) {
zones.push(value.value)
} else if (isArrayExpression(value)) {
const values = value.elements
.filter((e) => isStringLiteral(e))
.map((e) => e.value)
zones.push(...values)
} else {
logger.warn(`'zone' property is not a string or array.`, { file })
return
}
}View on GitHub (pinned to 5e06e544a2)
Solutions
- Replace backticks with single or double quotes in the zone value
- Ensure no interpolation in zone strings
- Restart the dev server
Example fix
// before
export const config = defineWidgetConfig({ zone: `product.details.after` })
// after
export const config = defineWidgetConfig({ zone: "product.details.after" }) Defensive patterns
Strategy: validation
Prevention
- Use single or double quotes for zone strings; never backticks
- Add a lint rule banning template literals in src/admin config files
When it happens
Trigger: zone: `product.details.after` (backticks) or an interpolated template literal in a widget config.
Common situations: Prettier converting single quotes to backticks via a rule; copy-paste from markdown docs where backticks wrapped the value.
Related errors
- 'model' property cannot be a template literal (e.g. `product
- 'zone' property is not a string or array.
- 'zone' property at the ${j} index of the 'forms' property ca
- 'model' is invalid. The 'model' property must be a string li
- 'zone' property is missing from the widget config.
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/27aa48ec900f0ea2.
Report an issue: GitHub.