{"record":{"id":"4c7d71b803ed7328","repo":"medusajs/medusa","slug":"step-registration-requires-id-received-json-st","errorCode":null,"errorMessage":"Step registration requires id. Received: ${JSON.stringify(data)}","messagePattern":"Step registration requires id\\. Received: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/utils/src/dev-server/handlers/step-handler.ts","lineNumber":8,"sourceCode":"import { ResourceEntry, ResourceTypeHandler, StepResourceData } from \"../types\"\n\nexport class StepHandler implements ResourceTypeHandler<StepResourceData> {\n  readonly type = \"step\"\n\n  constructor(private inverseRegistry: Map<string, string[]>) {}\n\n  validate(data: StepResourceData): void {\n    if (!data.id) {\n      throw new Error(\n        `Step registration requires id. Received: ${JSON.stringify(data)}`\n      )\n    }\n\n    if (!data.sourcePath && !data.workflowId) {\n      throw new Error(\n        `Step registration requires either sourcePath or workflowId. Received: ${JSON.stringify(\n          data\n        )}`\n      )\n    }\n  }\n\n  resolveSourcePath(data: StepResourceData): string {\n    if (data.sourcePath) {\n      return data.sourcePath","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/utils/src/dev-server/handlers/step-handler.ts#L1-L26","documentation":"Dev-server validation error from StepHandler.validate: a workflow-step resource was registered without an `id`. Steps are tracked in an inverse registry (which workflow uses which step file) to support hot-reload, so a missing id aborts registration.","triggerScenarios":"Calling the step registration API with data lacking the step id — typically the step's unique name string; loaders that derive ids from step configuration and end up with undefined; registering an inline arrow-function step that was never assigned a name.","commonSituations":"Custom tooling or plugins that auto-register steps from files; refactoring step names while the registration path still reads the old property; creating steps with createStep dynamically where the id variable is misspelled.","solutions":["Pass the step's unique id (the first argument given to createStep) in the registration data.","If the id is computed, assert it is a non-empty string before registering.","Register steps with type 'step' and include either sourcePath or workflowId alongside the id."],"exampleFix":"// before\nregisterDevServerResource({ type: 'step', sourcePath, workflowId }) // no id\n\n// after\nregisterDevServerResource({ type: 'step', id: 'create-order-step', sourcePath, workflowId })","handlingStrategy":"validation","validationCode":"if (!data.id) throw new Error(`Missing step id: ${JSON.stringify(data)}`)","typeGuard":"function isStepResourceData(d: unknown): d is StepResourceData {\n  return !!d && typeof (d as any).id === 'string' && !!(d as any).sourcePath || !!(d as any).workflowId\n}","tryCatchPattern":null,"preventionTips":["Always pass createStep's first argument as the registration id.","Keep a single constant for each step id and reference it everywhere.","Assert required registration fields in dev builds."],"tags":["dev-server","step","workflow","registration","validation","hot-reload"],"backgroundTag":"missing-required-field-registration","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}