{"record":{"id":"08606f1d829d41e1","repo":"codex-team/editor.js","slug":"holderid-and-holder-param-can-t-assign-at-the","errorCode":null,"errorMessage":"«holderId» and «holder» param can't assign at the same time.","messagePattern":"«holderId» and «holder» param can't assign at the same time\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/components/core.ts","lineNumber":207,"sourceCode":"  }\n\n  /**\n   * Returns private property\n   *\n   * @returns {EditorConfig}\n   */\n  public get configuration(): EditorConfig {\n    return this.config;\n  }\n\n  /**\n   * Checks for required fields in Editor's config\n   */\n  public validate(): void {\n    const { holderId, holder } = this.config;\n\n    if (holderId && holder) {\n      throw Error('«holderId» and «holder» param can\\'t assign at the same time.');\n    }\n\n    /**\n     * Check for a holder element's existence\n     */\n    if (_.isString(holder) && !$.get(holder)) {\n      throw Error(`element with ID «${holder}» is missing. Pass correct holder's ID.`);\n    }\n\n    if (holder && _.isObject(holder) && !$.isElement(holder)) {\n      throw Error('«holder» value must be an Element node');\n    }\n  }\n\n  /**\n   * Initializes modules:\n   *  - make and save instances\n   *  - configure","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/codex-team/editor.js/blob/5f45dabbe5690b7033b2f9047d3985add5045fdd/src/components/core.ts#L189-L225","documentation":"Editor's config validation rejects specifying both `holderId` and `holder`; they are alternative ways to point at the mounting element, and passing both is ambiguous, so the constructor throws immediately.","triggerScenarios":"Creating an editor with { holderId: 'editorjs', holder: 'editorjs', ... } or merging configs where both keys survive (spread/defaults combination).","commonSituations":"Config built by Object.assign/spread of a base config plus overrides; migrating old holderId code while adding holder; copy-pasted examples combining both parameters.","solutions":["Remove one of the two keys — prefer the modern `holder`","Sanitize merged config: delete holderId when holder is set","Centralize editor config construction so both keys can't be supplied"],"exampleFix":"// before\nnew EditorJS({ holderId: 'editorjs', holder: 'editorjs', tools });\n// after\nnew EditorJS({ holder: 'editorjs', tools });","handlingStrategy":"validation","validationCode":"if (cfg.holderId && cfg.holder) delete cfg.holderId; new EditorJS(cfg);","typeGuard":"const hasSingleHolder = (c: { holder?: unknown; holderId?: unknown }): boolean => !(c.holder && c.holderId);","tryCatchPattern":"try { new EditorJS(cfg); } catch (e) { if (e instanceof Error && e.message.includes('at the same time')) { delete cfg.holderId; new EditorJS(cfg); return; } throw e; }","preventionTips":["Use only the `holder` option","Sanitize merged configs before construction"],"tags":["config","holder","validation","editorjs"],"backgroundTag":"config-validation-failed","analyzedSha":"5f45dabbe5690b7033b2f9047d3985add5045fdd","analyzedAt":"2026-08-27T22:50:23.124Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}