{"record":{"id":"b15ff4fd908231c7","repo":"medusajs/medusa","slug":"link-property-is-missing","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/generate-custom-field-displays.ts","lineNumber":173,"sourceCode":"        displays = getDisplays(path, model, index, file)\n        hasLink = validateLink(path, file)\n      },\n    })\n  } catch (err) {\n    logger.error(`An error occurred while traversing the file.`, {\n      file,\n      error: err,\n    })\n    return null\n  }\n\n  if (!model) {\n    logger.warn(`'model' property is missing.`, { file })\n    return null\n  }\n\n  if (!hasLink) {\n    logger.warn(`'link' property is missing.`, { file })\n    return null\n  }\n\n  return {\n    import: import_,\n    model,\n    displays,\n  }\n}\n\nfunction getDisplays(\n  path: NodePath<ExportDefaultDeclaration>,\n  model: CustomFieldModel,\n  index: number,\n  file: string\n): CustomFieldDisplay[] | null {\n  const configArgument = getConfigArgument(path)\n","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-displays.ts#L155-L191","documentation":"Companion check to the 'model' warning: the custom-field display generator requires a 'link' property pointing to the module-link definition file that ties the custom model to a core model. Without a parseable link, the plugin cannot wire the display's data and skips the file with this warning.","triggerScenarios":"A custom-field display config whose default export lacks the link property (path to the link definition), or where link is present but not statically parseable by the AST-based generator.","commonSituations":"Copying a display example but omitting the link path; moving link files without updating the path string; using a dynamic/computed value for link the parser can't read.","solutions":["Add link: \"<path-to-link-file>\" to the default export in the file named in the warning","Confirm the path resolves from the project root and the link module exists and exports a valid model link","Keep the property a plain string literal"],"exampleFix":"// before\nexport default {\n  model: \"brand\",\n  displays: [/* ... */],\n}\n\n// after\nexport default {\n  model: \"brand\",\n  link: \"./src/links/product-brand\",\n  displays: [/* ... */],\n}","handlingStrategy":"validation","validationCode":"if (typeof cfg.link !== \"string\") {\n  throw new Error(\"display config is missing 'link' — it will be skipped\")\n}","typeGuard":"const hasDisplayLink = (c: unknown): c is { link: string } =>\n  typeof c === \"object\" && c !== null && typeof (c as any).link === \"string\"","tryCatchPattern":"null","preventionTips":["Always pair model with link in custom-field configs","Verify link file paths exist on disk before starting the dev server","Use plain string literals for paths"],"tags":["custom-fields","admin-vite-plugin","display-config","module-link"],"backgroundTag":"invalid-custom-field-config","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}