medusajs/medusa · error · MedusaError
Field(s) are required to have value to continue - ${invalidF
Error message
Field(s) are required to have value to continue - ${invalidFields} What it means
Generic presence-check step (validatePresenceOfStep) that throws INVALID_DATA when one or more required fields on the input object are undefined/null. Workflows use it to enforce that caller-supplied values exist before continuing.
Source
Thrown at packages/core/core-flows/src/common/steps/validate-presence-of.ts:27
async function ({
entity,
fields,
}: {
entity: Record<any, unknown>
fields: string[]
}) {
const invalid: string[] = []
for (const field of fields) {
if (!isPresent(entity[field])) {
invalid.push(field)
}
}
if (invalid.length) {
const invalidFields = invalid.join(", ")
throw new MedusaError(
MedusaError.Types.INVALID_DATA,
`Field(s) are required to have value to continue - ${invalidFields}`
)
}
}
)
View on GitHub (pinned to 5e06e544a2)
Solutions
- Read the error message suffix — it names the exact missing fields
- Add the missing field(s) to the workflow input before running
- If building inputs dynamically, strip undefined keys and assert required fields with a schema (zod) before invoking the workflow
Example fix
// before
await someWorkflow(container).run({ input: { currency_code: undefined } })
// throws: Field(s) are required to have value to continue - currency_code
// after
await someWorkflow(container).run({ input: { currency_code: "usd" } }) Defensive patterns
Strategy: validation
Validate before calling
const missing = presence.filter((f) => input[f] == null)
if (missing.length) throw new Error(`Missing required fields: ${missing.join(", ")}`) Try / catch
try { await workflow(scope).run({ input }) } catch (e) { if (e.type === MedusaError.Types.INVALID_DATA && /required to have value/.test(e.message)) { /* extract field names from message and prompt user */ } throw e } Prevention
- Validate workflow input with zod before running
- Parse the field list from the message to map back to form fields
- Strip undefined keys when building inputs dynamically
When it happens
Trigger: Invoking a workflow that wraps validatePresenceOfStep without supplying one of the fields listed in its 'presence' config (e.g. missing id, missing email, missing currency_code depending on the workflow).
Common situations: Client sends a partial payload; form field omitted; integration builds the workflow input dynamically and a property ends up undefined; API schema loosened in an upgrade so previously-required fields are no longer auto-validated earlier.
Related errors
- Missing required property ${prop} for geo zone type ${geoZon
- apply_to_quantity is a required field for Promotion type of
- buy_rules_min_quantity is a required field for Promotion typ
- application_method.max_quantity is a required field for Prom
- application_method.apply_to_quantity is a required field for
AI-assisted analysis of medusajs/medusa@5e06e544a2 (2026-08-27).
Data as JSON: /api/errors/7dde2ad9743a2785.
Report an issue: GitHub.