{"record":{"id":"9b93fb94fbe4dfca","repo":"hexojs/hexo","slug":"name-is-required-9b93fb","errorCode":null,"errorMessage":"name is required","messagePattern":"name is required","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/extend/deployer.ts","lineNumber":41,"sourceCode":"    return this.store;\n  }\n\n  get(name: string): StoreFunction {\n    return this.store[name];\n  }\n\n  register(\n    name: string,\n    fn: (\n      this: Hexo,\n      deployArg: {\n        type: string;\n        [key: string]: any;\n      },\n      callback?: NodeJSLikeCallback<any>\n    ) => any\n  ): void {\n    if (!name) throw new TypeError('name is required');\n    if (typeof fn !== 'function') throw new TypeError('fn must be a function');\n\n    if (fn.length > 1) {\n      fn = Promise.promisify(fn);\n    } else {\n      fn = Promise.method(fn);\n    }\n\n    this.store[name] = fn;\n  }\n}\n\nexport = Deployer;\n","sourceCodeStart":23,"sourceCodeEnd":55,"githubUrl":"https://github.com/hexojs/hexo/blob/059cb17494d0632a053c24077f5bcb6ae92acc51/lib/extend/deployer.ts#L23-L55","documentation":"Thrown by Deployer.register when the 'name' argument is falsy. Hexo deployers are identified by a name (e.g. 'git', 'rsync') used in the deploy config; a falsy name would make the deployment unselectable, so registration is rejected.","triggerScenarios":"Calling hexo.extend.deployer.register('', fn) or register(undefined, fn).","commonSituations":"A deployer plugin derives its name from package.json name field that is empty, or a dynamic registration loop produced an empty name.","solutions":["Pass a non-empty name string identifying the deployer.","Validate the name source (config/package) before registering.","Ensure dynamic registration does not pass undefined."],"exampleFix":"// before\nhexo.extend.deployer.register(deployerName, fn);\n// after\nif (deployerName) hexo.extend.deployer.register(deployerName, fn);","handlingStrategy":"validation","validationCode":"if (!name) throw new Error('deployer name required');\nhexo.extend.deployer.register(name, fn);","typeGuard":"const isValidName = (n: unknown): n is string => typeof n === 'string' && n.length > 0;","tryCatchPattern":null,"preventionTips":["Derive deployer names from a constant, not loose config.","Validate in a shared registerDeployer helper.","Test that the deployer name appears in hexo.extend.deployer.list()."],"tags":["deployer","deploy","validation","plugin"],"backgroundTag":null,"analyzedSha":"059cb17494d0632a053c24077f5bcb6ae92acc51","analyzedAt":"2026-08-12T20:52:05.731Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}