medusajs/medusa · warning
'link' property is missing.
Error message
'link' property is missing.
What it means
As part of validating custom field configs, validateLink checks that the object passed to defineCustomFieldConfig includes a `link` property. Without it the generated link registration would be broken, so validation fails (returns false) and the config is reported as invalid.
Source
Thrown at packages/admin/admin-vite-plugin/src/custom-fields/helpers.ts:111
* @param file - The file path.
* @returns - True if the 'link' property is present, false otherwise.
*/
export function validateLink(
path: NodePath<ExportDefaultDeclaration>,
file: string
): boolean {
const configArgument = getConfigArgument(path)
if (!configArgument) {
return false
}
const linkProperty = configArgument.properties.find(
(p) => isObjectProperty(p) && isIdentifier(p.key, { name: "link" })
) as ObjectProperty | undefined
if (!linkProperty) {
logger.warn(`'link' property is missing.`, { file })
return false
}
return true
}
View on GitHub (pinned to 5e06e544a2)
Solutions
- Add the `link` property pointing to the link exported from ./links
- Create the links.ts file with defineLink if it does not exist
- Re-run the build/dev server to revalidate
Example fix
// before
export default defineCustomFieldConfig({ model: "product" })
// after
import link from "./links"
export default defineCustomFieldConfig({ model: "product", link }) Defensive patterns
Strategy: validation
Validate before calling
const cfg = defineCustomFieldConfig(...)
if (!("link" in cfg)) throw new Error("'link' property is required") Type guard
const hasLinkKey = (c: object): c is { link: unknown } => "link" in c Prevention
- Type configs explicitly with the CustomFieldConfig type so missing keys fail tsc
- Use the official custom-field scaffold/generator if available
When it happens
Trigger: A custom field config object literal without a `link` key, validated during the plugin's config validation pass.
Common situations: New custom field created from a partial template; link import removed during cleanup but config left in place.
Related errors
- 'validation' property is missing at the ${j} index of the 'f
- 'model' is invalid, received: ${model}. The 'model' property
- No product ids passed to remove from price list
- Invalid rule attribute - ${ruleAttributeId}
- Invalid param rule_type (${ruleType})
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/a68f8d13a41071f1.
Report an issue: GitHub.