{"record":{"id":"4e7bdcaa25cb03a5","repo":"strapi/strapi","slug":"content-type-uid-has-already-been-registered","errorCode":null,"errorMessage":"Content-type ${uid} has already been registered.","messagePattern":"Content-type (.+?) has already been registered\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/core/src/registries/content-types.ts","lineNumber":64,"sourceCode":"    /**\n     * Registers a contentType\n     */\n    set(uid: UID.ContentType, contentType: Struct.ContentTypeSchema) {\n      contentTypes[uid] = contentType;\n      return this;\n    },\n\n    /**\n     * Registers a map of contentTypes for a specific namespace\n     */\n    add(namespace: string, newContentTypes: ContentTypesInput) {\n      validateKeySameToSingularName(newContentTypes);\n\n      for (const rawCtName of Object.keys(newContentTypes)) {\n        const uid = addNamespace(rawCtName, namespace);\n\n        if (has(uid, contentTypes)) {\n          throw new Error(`Content-type ${uid} has already been registered.`);\n        }\n\n        contentTypes[uid] = createContentType(uid, newContentTypes[rawCtName]);\n      }\n    },\n\n    /**\n     * Wraps a contentType to extend it\n     */\n    extend(ctUID: UID.ContentType, extendFn: ContentTypeExtendFn) {\n      const currentContentType = this.get(ctUID);\n\n      if (!currentContentType) {\n        throw new Error(`Content-Type ${ctUID} doesn't exist`);\n      }\n\n      extendFn(currentContentType);\n","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/strapi/strapi/blob/4a4101264d7098754df36e85fa629fd2f2349d8c/packages/core/core/src/registries/content-types.ts#L46-L82","documentation":"Thrown by the content-types Registry's `add` method when a UID (namespace + key) is already in the registry. Content-type UIDs must be unique across the whole app (e.g. 'api::article.article'); a duplicate means two sources contribute the same UID.","triggerScenarios":"Two content-type definitions resolve to the same namespaced UID; a plugin and the app both declare 'api::foo.foo'; calling add() twice with the same namespace/key.","commonSituations":"Two API folders with the same content-type name; plugin content-type colliding with an app content-type; duplicate scaffolding; stale build artifacts re-registering.","solutions":["Search for the duplicate UID across src/api and packages/plugins/*/server/src/content-types.","Rename one of the colliding content-types (folder + singularName).","Remove stale content-type folders from a previous rename.","Restart after clearing the dist/.cache build output."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function safeAddContentType(strapi, namespace, map) {\n  const existing = Object.keys(strapi.contentTypes);\n  for (const key of Object.keys(map)) {\n    const uid = `${namespace}::${key}.${key}`;\n    if (existing.includes(uid)) {\n      throw new Error(`Duplicate content-type UID detected: ${uid}`);\n    }\n  }\n  strapi.container.get('content-types').add(namespace, map);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep content-type folder names unique across api/ and plugins/.","Clear .cache and dist when renaming to avoid stale double-registration.","CI: assert no two schema.json files share the same namespaced UID."],"tags":["registry","content-types","startup","duplicate"],"backgroundTag":null,"analyzedSha":"4a4101264d7098754df36e85fa629fd2f2349d8c","analyzedAt":"2026-08-12T12:47:50.760Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}