{"record":{"id":"106810c62e2e9522","repo":"medusajs/medusa","slug":"job-registration-requires-config-name-received","errorCode":null,"errorMessage":"Job registration requires config.name. Received: ${JSON.stringify(data)}","messagePattern":"Job registration requires config\\.name\\. Received: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/utils/src/dev-server/handlers/job-handler.ts","lineNumber":20,"sourceCode":"\nexport class JobHandler implements ResourceTypeHandler<JobResourceData> {\n  readonly type = \"job\"\n\n  validate(data: JobResourceData): void {\n    if (!data.id) {\n      throw new Error(\n        `Job registration requires id. Received: ${JSON.stringify(data)}`\n      )\n    }\n\n    if (!data.sourcePath) {\n      throw new Error(\n        `Job registration requires sourcePath. Received: ${JSON.stringify(\n          data\n        )}`\n      )\n    }\n\n    if (!data.config?.name) {\n      throw new Error(\n        `Job registration requires config.name. Received: ${JSON.stringify(\n          data\n        )}`\n      )\n    }\n  }\n\n  resolveSourcePath(data: JobResourceData): string {\n    return data.sourcePath\n  }\n\n  createEntry(data: JobResourceData): ResourceEntry {\n    return {\n      id: data.id,\n      config: data.config,\n    }","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/utils/src/dev-server/handlers/job-handler.ts#L2-L38","documentation":"Dev-server validation error from JobHandler.validate: the job resource's config object is missing its `name` property (config?.name is falsy). The scheduler identifies a job by config.name, so a job registration without it cannot be scheduled or hot-reloaded and is rejected.","triggerScenarios":"Registering a job whose config only has a schedule (e.g. { schedule: '* * * * *' }) but no name; passing the whole module export as config when the name lives one level deeper; typo like `config: { Name: ... } }`.","commonSituations":"Writing a custom scheduled job config object and forgetting the name key; Medusa job configs require name plus schedule — omitting name commonly happens when copying a workflow-style config; config built from user input where name is optional and left empty.","solutions":["Add a non-empty config.name to the job registration config (this is the identifier used by the scheduler).","Make sure config itself is an object and name is at config.name, not a sibling field.","Keep id and config.name consistent to avoid duplicate registrations of the same job under two identities."],"exampleFix":"// before\nregisterDevServerResource({\n  type: 'job', id: 'daily-report', sourcePath,\n  config: { schedule: '0 1 * * *' }, // no name\n})\n\n// after\nregisterDevServerResource({\n  type: 'job', id: 'daily-report', sourcePath,\n  config: { name: 'daily-report', schedule: '0 1 * * *' },\n})","handlingStrategy":"validation","validationCode":"if (!config?.name) throw new Error(`Job config missing name: ${JSON.stringify(config)}`)","typeGuard":"function hasJobName(c: unknown): c is { name: string } {\n  return typeof (c as any)?.name === 'string' && (c as any).name.length > 0\n}","tryCatchPattern":null,"preventionTips":["Use config.name as the canonical job identifier and reuse it for id.","Type your job configs so name is required at compile time.","Validate configs at load time in one place rather than per registration."],"tags":["dev-server","job","config","name","registration","validation"],"backgroundTag":"missing-required-field-registration","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}