twentyhq/twenty · critical · Error
Block Settings command menu item is missing from the standar
Error message
Block Settings command menu item is missing from the standard application definition
What it means
Thrown by the 2.28 command that adds the Block Settings (email) command menu item. It computes the standard application's flat entity maps and looks up EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER in flatCommandMenuItemMaps; if undefined, it throws. This is a code/definition defect, not a data defect: the standard application definition shipped in the running code does not contain an entry for that universal identifier, so the command cannot source the entity to create.
Source
Thrown at packages/twenty-server/src/database/commands/upgrade-version-command/2-28/2-28-workspace-command-1785921674941-add-email-block-settings-command-menu-item.command.ts:95
);
return;
}
const { allFlatEntityMaps: standardAllFlatEntityMaps } =
computeTwentyStandardApplicationAllFlatEntityMaps({
now: new Date().toISOString(),
workspaceId,
twentyStandardApplicationId: twentyStandardFlatApplication.id,
});
const itemToCreate =
standardAllFlatEntityMaps.flatCommandMenuItemMaps.byUniversalIdentifier[
EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER
];
if (!isDefined(itemToCreate)) {
throw new Error(
`Block Settings command menu item is missing from the standard application definition`,
);
}
this.logger.log(
`${isDryRun ? '[DRY RUN] ' : ''}Adding the Block Settings command menu item for workspace ${workspaceId}`,
);
if (isDryRun) {
return;
}
const validateAndBuildResult =
await this.workspaceMigrationValidateBuildAndRunService.validateBuildAndRunLegacyWorkspaceMigration(
{
isSystemBuild: true,
allFlatEntityOperationByMetadataName: {
commandMenuItem: {View on GitHub (pinned to 1f5dd2bbd2)
Solutions
- Grep the standard application definition for EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER to confirm it is actually defined and exported.
- If missing, add the command menu item to the standard definition (or correct the constant/import) so the lookup resolves.
- Rebuild twenty-shared before twenty-server (npx nx build twenty-shared) so the server sees the current definitions.
- Verify the universal identifier spelling matches exactly between the command and the definition map key.
Example fix
// before — definition map has no entry, lookup returns undefined
// const itemToCreate =
// standardAllFlatEntityMaps.flatCommandMenuItemMaps.byUniversalIdentifier[
// EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER // not a key in the map
// ];
// after — add the entry to the standard command-menu-item definitions:
// [EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER]: { ...FieldDefinition }
// so the lookup resolves and the command proceeds. Defensive patterns
Strategy: validation
Validate before calling
// Assert the standard definition actually defines the item before running the command:
const maps = computeTwentyStandardApplicationAllFlatEntityMaps({
now: new Date().toISOString(), workspaceId, twentyStandardApplicationId,
});
if (!isDefined(maps.allFlatEntityMaps.flatCommandMenuItemMaps.byUniversalIdentifier[EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER])) {
throw new Error('Fix the standard definition before running the upgrade');
} Type guard
const hasStandardCommandMenuItem = ( maps: AllFlatEntityMaps, ui: string, ): ui is string => isDefined(maps.flatCommandMenuItemMaps.byUniversalIdentifier[ui]);
Prevention
- Keep the upgrade command and its standard-definition edit in the same commit.
- Rebuild twenty-shared before twenty-server (npx nx build twenty-shared) so definitions are current.
- Add a unit test asserting the universal identifier resolves from the standard map.
When it happens
Trigger: The constant EMAIL_BLOCK_SETTINGS_UNIVERSAL_IDENTIFIER does not match any key in the standard command-menu-item definitions (typo, renamed constant, or the definition file was not updated in the same commit as the command). Also occurs if a cherry-picked command file landed without its companion definition change.
Common situations: A partial merge/cherry-pick that brought the upgrade command but not the standard-application-definition edit; a constant rename in twenty-shared/application that was not propagated; running a build whose twenty-shared package was not rebuilt (stale transpiled output).
Related errors
- Failed to sync "Discard Draft" workflow command menu item av
- Failed to add the Block Settings command menu item for works
- Failed to sync command menu item availability expressions fo
- Failed to update search command menu item labels for workspa
- Failed to add Send Email record-selection commands for works
AI-assisted analysis of twentyhq/twenty@1f5dd2bbd2 (2026-08-12).
Data as JSON: /api/errors/f7e82eb9acf2ba08.
Report an issue: GitHub.