{"record":{"id":"a68f8d13a41071f1","repo":"medusajs/medusa","slug":"link-property-is-missing-a68f8d","errorCode":null,"errorMessage":"'link' property is missing.","messagePattern":"'link' property is missing\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/admin/admin-vite-plugin/src/custom-fields/helpers.ts","lineNumber":111,"sourceCode":" * @param file - The file path.\n * @returns - True if the 'link' property is present, false otherwise.\n */\nexport function validateLink(\n  path: NodePath<ExportDefaultDeclaration>,\n  file: string\n): boolean {\n  const configArgument = getConfigArgument(path)\n\n  if (!configArgument) {\n    return false\n  }\n\n  const linkProperty = configArgument.properties.find(\n    (p) => isObjectProperty(p) && isIdentifier(p.key, { name: \"link\" })\n  ) as ObjectProperty | undefined\n\n  if (!linkProperty) {\n    logger.warn(`'link' property is missing.`, { file })\n    return false\n  }\n\n  return true\n}\n","sourceCodeStart":93,"sourceCodeEnd":117,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/helpers.ts#L93-L117","documentation":"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.","triggerScenarios":"A custom field config object literal without a `link` key, validated during the plugin's config validation pass.","commonSituations":"New custom field created from a partial template; link import removed during cleanup but config left in place.","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"],"exampleFix":"// before\nexport default defineCustomFieldConfig({ model: \"product\" })\n\n// after\nimport link from \"./links\"\nexport default defineCustomFieldConfig({ model: \"product\", link })","handlingStrategy":"validation","validationCode":"const cfg = defineCustomFieldConfig(...)\nif (!(\"link\" in cfg)) throw new Error(\"'link' property is required\")","typeGuard":"const hasLinkKey = (c: object): c is { link: unknown } => \"link\" in c","tryCatchPattern":null,"preventionTips":["Type configs explicitly with the CustomFieldConfig type so missing keys fail tsc","Use the official custom-field scaffold/generator if available"],"tags":["admin","custom-fields","validation","link"],"backgroundTag":"missing-config-property","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}