{"record":{"id":"81e954d514d86fbf","repo":"twentyhq/twenty","slug":"defineapplication-in-configpath-must-declare-a","errorCode":null,"errorMessage":"defineApplication in ${configPath} must declare a universalIdentifier before generating entities.","messagePattern":"defineApplication in (.+?) must declare a universalIdentifier before generating entities\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/twenty-sdk/src/cli/utilities/application/get-application-universal-identifier-or-throw.ts","lineNumber":32,"sourceCode":"export const getApplicationUniversalIdentifierOrThrow = async (\n  appPath: string,\n): Promise<string> => {\n  const configPath = await findAppConfigPath(appPath);\n\n  if (configPath === null) {\n    throw new Error(\n      `Could not find the application config file (expected one of: ${APP_CONFIG_CANDIDATE_PATHS.join(', ')}). Create it with defineApplication({ universalIdentifier: ... }) before generating entities.`,\n    );\n  }\n\n  const { config } =\n    await extractManifestFromFile<ApplicationConfigWithUniversalIdentifier>({\n      appPath,\n      filePath: configPath,\n    });\n\n  if (!config?.universalIdentifier) {\n    throw new Error(\n      `defineApplication in ${configPath} must declare a universalIdentifier before generating entities.`,\n    );\n  }\n\n  return config.universalIdentifier;\n};\n","sourceCodeStart":14,"sourceCodeEnd":39,"githubUrl":"https://github.com/twentyhq/twenty/blob/1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6/packages/twenty-sdk/src/cli/utilities/application/get-application-universal-identifier-or-throw.ts#L14-L39","documentation":"Thrown by the Twenty SDK CLI when it found an application config file at a recognized path but the extracted config object has no universalIdentifier property. The universalIdentifier is the root seed for all deterministically generated identifiers, so its absence makes code generation impossible. This is a stricter check than error 82 — the file exists but is incomplete.","triggerScenarios":"The config file is found but defineApplication was called without a universalIdentifier argument, or the config object extracted from the manifest is empty/undefined. This can also happen if extractManifestFromFile cannot statically analyze the defineApplication call's arguments.","commonSituations":"Developer created the config file with defineApplication({ name: 'MyApp' }) but forgot universalIdentifier. Or they used defineApplication() with no arguments. The file was created from an outdated template that didn't include the field.","solutions":["Add universalIdentifier to your defineApplication call: defineApplication({ universalIdentifier: 'com.yourcompany.yourapp' }).","Use a reverse-DNS format for the identifier to ensure global uniqueness (e.g. com.acme.sales-tools).","Ensure the value is a non-empty string — empty strings are falsy and will fail the !config?.universalIdentifier check.","Verify the defineApplication call is exported as default from the config file so the manifest extractor can read it."],"exampleFix":"// before — src/application.config.ts\nimport { defineApplication } from 'twenty-sdk';\nexport default defineApplication({ name: 'MyApp' });\n\n// after\nimport { defineApplication } from 'twenty-sdk';\nexport default defineApplication({\n  universalIdentifier: 'com.acme.sales-tools',\n  name: 'MyApp',\n});","handlingStrategy":"validation","validationCode":"import { extractManifestFromFile } from '@/cli/utilities/build/manifest/manifest-extract-config-from-file';\n\nconst config = (await extractManifestFromFile({\n  appPath,\n  filePath: configPath,\n})).config;\n\nif (!config?.universalIdentifier) {\n  throw new Error('Add universalIdentifier to your defineApplication call.');\n}","typeGuard":"const hasUniversalIdentifier = (\n  config: unknown,\n): config is { universalIdentifier: string } => {\n  return (\n    typeof config === 'object' &&\n    config !== null &&\n    'universalIdentifier' in config &&\n    typeof (config as { universalIdentifier: unknown }).universalIdentifier === 'string' &&\n    (config as { universalIdentifier: string }).universalIdentifier.length > 0\n  );\n};","tryCatchPattern":"try {\n  const id = await getApplicationUniversalIdentifierOrThrow(appPath);\n} catch (error) {\n  if (error instanceof Error && error.message.includes('must declare a universalIdentifier')) {\n    console.error('Add universalIdentifier to src/application.config.ts');\n    process.exit(1);\n  }\n  throw error;\n}","preventionTips":["Use a reverse-DNS format for universalIdentifier to guarantee uniqueness.","Verify the config file exports defineApplication result as default.","Run a quick check after scaffolding: ensure universalIdentifier is a non-empty string."],"tags":["sdk-cli","configuration","scaffolding","validation"],"backgroundTag":null,"analyzedSha":"1f5dd2bbd2a8da3419c8cfd52dd545c0024df1a6","analyzedAt":"2026-08-12T15:37:27.593Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}