twentyhq/twenty · critical · Error
Could not find standard entity ${universalIdentifier}
Error message
Could not find standard entity ${universalIdentifier} What it means
Thrown by getStandardFlatEntitiesToCreateOrThrow when a requested universalIdentifier is not present in standardFlatEntityMaps.byUniversalIdentifier. This signals a contract mismatch: the caller asked for a standard entity the installed standard-metadata build does not define. The function then skips any that already exist in the workspace.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-10/utils/get-standard-flat-entities-to-create-or-throw.util.ts:22
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
export const getStandardFlatEntitiesToCreateOrThrow = <
T extends SyncableFlatEntity,
>({
standardFlatEntityMaps,
existingFlatEntityMaps,
universalIdentifiers,
}: {
standardFlatEntityMaps: FlatEntityMaps<T>;
existingFlatEntityMaps: FlatEntityMaps<T>;
universalIdentifiers: string[];
}): T[] =>
universalIdentifiers.flatMap((universalIdentifier) => {
const standardFlatEntity =
standardFlatEntityMaps.byUniversalIdentifier[universalIdentifier];
if (!isDefined(standardFlatEntity)) {
throw new Error(`Could not find standard entity ${universalIdentifier}`);
}
if (
isDefined(
existingFlatEntityMaps.byUniversalIdentifier[universalIdentifier],
)
) {
return [];
}
return [standardFlatEntity];
});
export const getExistingOrStandardFlatEntityOrThrow = <
T extends SyncableFlatEntity,
>({
standardFlatEntityMaps,
existingFlatEntityMaps,View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Verify every universalIdentifier passed in exists in standardFlatEntityMaps.byUniversalIdentifier for the installed build.
- Align twenty-shared/metadata and twenty-server to the same version so STANDARD_OBJECTS includes the referenced entity.
- Correct any typo'd or hardcoded UUID in the calling command.
Example fix
// before: passes identifiers blindly, throws if any is missing
const toCreate = getStandardFlatEntitiesToCreateOrThrow({
standardFlatEntityMaps,
existingFlatEntityMaps,
universalIdentifiers,
});
// after: filter to known standards first
const known = universalIdentifiers.filter((id) =>
isDefined(standardFlatEntityMaps.byUniversalIdentifier[id]),
);
const toCreate = getStandardFlatEntitiesToCreateOrThrow({
standardFlatEntityMaps,
existingFlatEntityMaps,
universalIdentifiers: known,
}); Defensive patterns
Strategy: type-guard
Validate before calling
import { isDefined } from 'twenty-shared/utils';
// Filter to identifiers that actually exist in the standard map before calling:
const known = universalIdentifiers.filter((id) =>
isDefined(standardFlatEntityMaps.byUniversalIdentifier[id]),
);
const toCreate = getStandardFlatEntitiesToCreateOrThrow({
standardFlatEntityMaps,
existingFlatEntityMaps,
universalIdentifiers: known,
}); Type guard
import { isDefined } from 'twenty-shared/utils';
const isKnownStandardEntity = <T>(
standardFlatEntityMaps: { byUniversalIdentifier: Record<string, T | undefined> },
universalIdentifier: string,
): universalIdentifier is string & keyof typeof standardFlatEntityMaps.byUniversalIdentifier =>
isDefined(standardFlatEntityMaps.byUniversalIdentifier[universalIdentifier]); Prevention
- Validate every universalIdentifier against the standard map before passing it in.
- Keep twenty-shared/metadata and twenty-server on the same version so STANDARD_OBJECTS includes all referenced entities.
- Avoid hardcoding UUIDs; reference them via the shared STANDARD_OBJECTS constant.
When it happens
Trigger: Passing a universalIdentifier list that includes an id absent from the standard flat entity maps — e.g. a constant from a newer/older twenty-shared metadata version than the server build, or a copy-paste typo in an identifier.
Common situations: Version skew between twenty-shared/metadata STANDARD_OBJECTS and the command code; an upgrade command references a standard entity introduced in a later build; identifier typo or stale hardcoded UUID.
Related errors
- Workspace custom application not found for workspace ${works
- Workspace custom application not found for workspace ${works
- GraphQL errors: ${json.errors.map((e) => e.message).join(';
- Field "${fieldName}" not found on object "${objectName}" aft
- Object "${name}" not found in workspace metadata. Has the ap
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/d552cd5df258b82a.
Report an issue: GitHub.