Skip to content
New issue

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

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

Already on GitHub? # to your account

Unexpected "RenderError: memory alloc limit exceeded" #737

Closed
jg-rp opened this issue Aug 23, 2024 · 0 comments · Fixed by KaliforniaShell/docs#5 · 4 remaining pull requests
Closed

Unexpected "RenderError: memory alloc limit exceeded" #737

jg-rp opened this issue Aug 23, 2024 · 0 comments · Fixed by KaliforniaShell/docs#5 · 4 remaining pull requests
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)

@harttle harttle added the bug label Aug 23, 2024
github-actions bot pushed a commit that referenced this issue Aug 23, 2024
## [10.16.4](v10.16.3...v10.16.4) (2024-08-23)

### Bug Fixes

* "filter is not a function" for uniq ([68387c3](68387c3))
* memory limit issue for join filter, fix [#737](#737) ([2d59cff](2d59cff))
# for free to join this conversation on GitHub. Already have an account? # to comment