You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
array_to_sentence_string throws on nil, number and string input #964
array_to_sentence_string uses its input as an array without checking what it is. So a missing variable, a number or a string throws a RenderError, and the whole template fails to render. The other array filters (join, reverse, sort, compact, uniq, …) all pass their input through toArray first, so this filter is the odd one out.
Version: 10.29.0
Repro:
const{ Liquid }=require('liquidjs')constengine=newLiquid()awaitengine.parseAndRender('{{ missing | array_to_sentence_string }}',{})// RenderError: Cannot read properties of undefined (reading 'length')awaitengine.parseAndRender('{{ n | array_to_sentence_string }}',{n: 5})// RenderError: array.slice is not a functionawaitengine.parseAndRender('{{ s | array_to_sentence_string }}',{s: 'abc'})// RenderError: array.slice(...).join is not a functionawaitengine.parseAndRender('{{ s | array_to_sentence_string }}',{s: 'ab'})// "a and b" (the string's characters are treated as items)
For comparison, join handles the same inputs without trouble:
Activity
fix(array_to_sentence_string): coerce non-array input with toArray (#968
chore(release): 10.30.1 [skip ci]
github-actions commentedon Oct 28, 2026
🎉 This issue has been resolved in version 10.30.1 🎉
The release is available on:
Your semantic-release bot 📦🚀