Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected "RenderError: memory alloc limit exceeded" #737

Closed
jg-rp opened this issue Aug 23, 2024 · 0 comments · May be fixed by organich/docs#3, AKJUS/wcag#3, organich/docs#4, organich/docs#5 or organich/docs#6
Closed
Labels

Comments

@jg-rp
Copy link
Contributor

jg-rp commented Aug 23, 2024

Since e443068, I'm getting "RenderError: memory alloc limit exceeded" from the following example.

import { Liquid } from "liquidjs";

const liquid = new Liquid();
const context = { x: ["a", "b"] };
const template = "{{ x | join: 5 }}";  // non-string argument
liquid.parseAndRender(template, context).then(console.log);

Output

memory alloc limit exceeded, line:1, col:1
>> 1| {{ x | join: 5 }}
      ^
RenderError: memory alloc limit exceeded, line:1, col:1
    at Render.renderTemplates (/home/james/tmp/liquidjs_usage/node_modules/liquidjs/dist/liquid.node.cjs.js:1204:53)
    at renderTemplates.throw (<anonymous>)
    at toPromise (/home/james/tmp/liquidjs_usage/node_modules/liquidjs/dist/liquid.node.cjs.js:520:32)
From AssertionError: memory alloc limit exceeded
.
.
.

Previously, the same template would output:

a5b

And the error message produced by {{ 123 | uniq }} has changed from:

RenderError: (arr || []).filter is not a function

to

RenderError: memory alloc limit exceeded

(Shopify/Liquid would coerce 123 to as single element array ([123]) and result in 123)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment