{"record":{"id":"82ea7ae455ceb9bc","repo":"elsa-workflows/elsa-core","slug":"unrecognized-fluidvalue","errorCode":null,"errorMessage":"Unrecognized FluidValue","messagePattern":"Unrecognized FluidValue","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/modules/Elsa.Expressions.Liquid/Filters/Base64Filter.cs","lineNumber":39,"sourceCode":"            return new ValueTask<FluidValue>(NilValue.Instance);\n\n        var bytes = Encoding.UTF8.GetBytes(text);\n        var base64 = Convert.ToBase64String(bytes);\n\n        return new ValueTask<FluidValue>(new StringValue(base64));\n    }\n\n    private static string? InputToString(FluidValue input, TemplateContext context)\n    {\n        return input.Type switch\n        {\n            FluidValues.Array => JsonSerializer.Serialize(input.Enumerate(context).Select(o => o.ToObjectValue())),\n            FluidValues.Boolean => input.ToBooleanValue().ToString(),\n            FluidValues.Nil => null,\n            FluidValues.Number => input.ToNumberValue().ToString(CultureInfo.InvariantCulture),\n            FluidValues.DateTime or FluidValues.Dictionary or FluidValues.Object => JsonSerializer.Serialize(input.ToObjectValue()),\n            FluidValues.String => input.ToStringValue(),\n            _ => throw new ArgumentOutOfRangeException(nameof(input), \"Unrecognized FluidValue\")\n        };\n    }\n}","sourceCodeStart":21,"sourceCodeEnd":42,"githubUrl":"https://github.com/elsa-workflows/elsa-core/blob/fe9217bdfa0e27f0e09e45006eb6898f616e513d/src/modules/Elsa.Expressions.Liquid/Filters/Base64Filter.cs#L21-L42","documentation":"InputToString in Base64Filter converts a Liquid (FluidValue) input to its string representation before base64 encoding. It switches on the FluidValue type and throws ArgumentOutOfRangeException when the value type is none of the handled kinds (e.g. FluidValues.Blank or future FluidValue kinds), signaling the filter received a value type it does not know how to stringify.","triggerScenarios":"Applying the base64 filter in a Liquid template to an input whose FluidValues kind is not Array, Boolean, Nil, Number, DateTime, Dictionary, Object, or String — most notably FluidValues.Blank, or a new FluidValue kind introduced by a Fluid library upgrade.","commonSituations":"Piping blank/empty values into {{ input | base64 }}, or upgrading the Fluid NuGet package so new FluidValue types reach the unhandled default case.","solutions":["Check what value is being piped into the base64 filter and ensure it is a string, number, boolean, array, or object","Guard the template with an if/blank check before applying the filter, e.g. {% if input %}{{ input | base64 }}{% endif %}","Catch ArgumentOutOfRangeException around expression evaluation or disable strict mode so it degrades gracefully","If caused by a Fluid package upgrade, update the Elsa.Expressions.Liquid package so the switch covers new FluidValue kinds"],"exampleFix":"// before\n{% if input %}{{ input | base64 }}{% endif %}\n// after (guard blank/empty explicitly)\n{% unless input == blank %}{{ input | base64 }}{% endunless %}","handlingStrategy":"type-guard","validationCode":"// before applying the filter\nif (input == blank)\n  return \"\"; // or skip base64","typeGuard":"{% if input != blank %}{{ input | base64 }}{% endif %}","tryCatchPattern":"try { result = Evaluate(template, model); }\ncatch (ArgumentOutOfRangeException ex) when (ex.Message.Contains(\"Unrecognized FluidValue\")) { result = null; }","preventionTips":["Never pipe blank/undefined values into base64","Pin and keep Elsa.Expressions.Liquid in sync with your Fluid package version","Test Liquid templates with all possible input shapes"],"tags":["liquid","fluid","base64","filter","argument-out-of-range"],"backgroundTag":"invalid-enum-value","analyzedSha":"fe9217bdfa0e27f0e09e45006eb6898f616e513d","analyzedAt":"2026-09-13T20:32:34.702Z","contentChangedAt":"2026-09-13T20:32:34.702Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}