no-non-serializable-step-return - ESLint plugin rules
This rule disallows non-serializable values, such as Map, Set, WeakMap, and WeakSet, inside new StepResponse(...) or new WorkflowResponse(...).
Severity#
error. This rule is enabled in the strict preset.
By default, Medusa projects use the recommended preset, which doesn't enable this rule. To use it, switch to the strict preset.
What it Targets#
This rule targets files in your project's src/workflows directory. It reports values passed to new StepResponse(...) or new WorkflowResponse(...) that contain a Map, Set, WeakMap, or WeakSet.
The following code is reported by the rule:
Instead, return a plain object or array:
Why it's Important
A step or workflow response must be serializable so the workflow engine can persist and pass it between steps. Values like Map and Set don't serialize to plain data and are lost. Use a plain object or array instead.
Learn more in the Workflow Constraints documentation.
Fixable#
This rule isn't auto-fixable.