medusajs/medusa · warning

'link' property is missing.

Error message

'link' property is missing.

What it means

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.

Source

Thrown at packages/admin/admin-vite-plugin/src/custom-fields/generate-custom-field-forms.ts:249

        configs = getConfigs(path, model, index, file)
        forms = getForms(path, model, index, file)
      },
    })
  } catch (err) {
    logger.error(`An error occurred while traversing the file.`, {
      file,
      error: err,
    })
    return null
  }

  if (!model) {
    logger.warn(`'model' property is missing.`, { file })
    return null
  }

  if (!hasLink) {
    logger.warn(`'link' property is missing.`, { file })
    return null
  }

  return {
    import: import_,
    model,
    configs,
    forms,
  }
}

function generateCustomFieldConfigName(index: number): string {
  return `CustomFieldConfig${index}`
}

function generateImport(file: string, index: number): string {
  const path = normalizePath(file)
  return `import ${generateCustomFieldConfigName(index)} from "${path}"`

View on GitHub (pinned to 5e06e544a2)

Solutions

  1. Add link: "<path-to-link-file>" to the default export in the flagged file
  2. Verify the referenced link file exists and defines the module link for the model named in model
  3. Use a plain string literal for the path

Example fix

// before
export default {
  model: "brand",
  forms: [/* ... */],
}

// after
export default {
  model: "brand",
  link: "./src/links/product-brand",
  forms: [/* ... */],
}
Defensive patterns

Strategy: validation

Validate before calling

if (typeof cfg.link !== "string") {
  throw new Error("form config is missing 'link' — it will be skipped")
}

Type guard

const hasFormLink = (c: unknown): c is { link: string } =>
  typeof c === "object" && c !== null && typeof (c as any).link === "string"

Try / catch

null

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27). Data as JSON: /api/errors/ecdb9238edd6cb94. Report an issue: GitHub.