{"record":{"id":"ecdb9238edd6cb94","repo":"medusajs/medusa","slug":"link-property-is-missing-ecdb92","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-forms.ts","lineNumber":249,"sourceCode":"        configs = getConfigs(path, model, index, file)\n        forms = getForms(path, model, index, 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    configs,\n    forms,\n  }\n}\n\nfunction generateCustomFieldConfigName(index: number): string {\n  return `CustomFieldConfig${index}`\n}\n\nfunction generateImport(file: string, index: number): string {\n  const path = normalizePath(file)\n  return `import ${generateCustomFieldConfigName(index)} from \"${path}\"`","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts#L231-L267","documentation":"The custom-field form generator also requires the 'link' property — the path to the module-link file connecting the custom model to a core model. Without a statically parseable link, the form's data binding cannot be generated and the file is skipped with this warning.","triggerScenarios":"A form config whose default export omits link, points to a nonexistent path, or defines link via a non-literal expression the parser can't evaluate.","commonSituations":"Omitting link when the custom field targets an existing column rather than a linked model; moving link files during refactors; typos in the relative path.","solutions":["Add link: \"<path-to-link-file>\" to the default export in the flagged file","Verify the referenced link file exists and defines the module link for the model named in model","Use a plain string literal for the path"],"exampleFix":"// before\nexport default {\n  model: \"brand\",\n  forms: [/* ... */],\n}\n\n// after\nexport default {\n  model: \"brand\",\n  link: \"./src/links/product-brand\",\n  forms: [/* ... */],\n}","handlingStrategy":"validation","validationCode":"if (typeof cfg.link !== \"string\") {\n  throw new Error(\"form config is missing 'link' — it will be skipped\")\n}","typeGuard":"const hasFormLink = (c: unknown): c is { link: string } =>\n  typeof c === \"object\" && c !== null && typeof (c as any).link === \"string\"","tryCatchPattern":"null","preventionTips":["Always include the module link path in form configs","Use string literals for link paths and verify the files exist","Pair model and link whenever adding new custom-field form files"],"tags":["custom-fields","form-config","module-link","build-warning"],"backgroundTag":"invalid-custom-field-config","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}