medusajs/medusa · error · MedusaError
Unsupported entity: ${entity}. Available entities include: $
Error message
Unsupported entity: ${entity}. Available entities include: ${entityNames.join(", ")}${availableEntities.length > 10 ? "..." : ""} What it means
Thrown by GET /admin/views/:entity/columns when the requested entity name is not among the discoverable entities registered in the settings module. Lists up to 10 available entity names in the message.
Source
Thrown at packages/medusa/src/api/admin/views/[entity]/columns/route.ts:34
res: MedusaResponse<HttpTypes.AdminViewsEntityColumnsResponse>
) => {
const entity = req.params.entity
const settingsService =
req.scope.resolve<SettingsTypes.ISettingsModuleService>(Modules.SETTINGS)
if (!settingsService.isEntityDiscoveryInitialized()) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
"Entity discovery has not been initialized. Please ensure the application has fully started."
)
}
if (!settingsService.hasEntity(entity)) {
const availableEntities = await settingsService.listDiscoverableEntities()
const entityNames = availableEntities.map((e) => e.pluralName).slice(0, 10)
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`Unsupported entity: ${entity}. Available entities include: ${entityNames.join(
", "
)}${availableEntities.length > 10 ? "..." : ""}`
)
}
const columns = await settingsService.generateEntityColumns(entity)
if (!columns) {
throw new MedusaError(
MedusaError.Types.UNEXPECTED_STATE,
`Failed to generate columns for entity: ${entity}`
)
}
return res.json({
columns,View on GitHub (pinned to 5e06e544a2)
Solutions
- Use the plural name of the entity (e.g. products, orders)
- Call listDiscoverableEntities or check the message's available list
- Ensure custom modules expose discoverable metadata if expected
Example fix
// before GET /admin/views/product/columns // after GET /admin/views/products/columns
Defensive patterns
Strategy: validation
Validate before calling
const ok = ['products','orders', ...].includes(entity)
if (!ok) throw new Error(`unknown entity ${entity}`) Type guard
const isKnownEntity = (e: string): e is ViewEntity => KNOWN_ENTITIES.includes(e)
Prevention
- Always use plural entity names
- Fetch the available entity list dynamically
When it happens
Trigger: GET /admin/views/foo/columns where 'foo' is not a discoverable entity plural name; using singular instead of plural (e.g. 'product' vs 'products').
Common situations: Guessing entity names in URL; custom module not registered as discoverable; naming mismatch after upgrading Medusa versions that rename entities.
Related errors
- Entity discovery has not been initialized. Please ensure the
- Nonexistent relations were passed during upsert: ${nonexiste
- Many-to-one relation ${relation.name} must be set with an ID
- Sales channels can only be associated with publishable API k
- INVALID_DATA
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/26f9d98e5073ca8a.
Report an issue: GitHub.