-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
$evaluateExpression cannot handle arrow function or inner function #1492
Comments
Thanks for reporting but that is sadly a known problem. It originates in the library that n8n uses underneath the hood for the expressions riot-tmpl. You can reproduce with it with you example like this: const tmpl = require('riot-tmpl').tmpl;
tmpl('{ [1, 2, 3, 4, 5].filter(v => v > 2).join(`,`) }', {}) Sadly do we currently not have the resources to fix that bug in that library and I am not even sure if it would get merged as it did not get updated for 4 years. So we would either have to fork it at some point or look for an alternative. |
Is there any workaround solution for this? |
Only using a Function-Node and then reference the value afterward. |
Is that also why
doesn't work? Or is it worth it to create a separate issue? |
Hey @nantoniazzi, I am just going through some older issues and it looks like this was fixed when we changed from Riot to Tournament in For now as this looks to be all good I am going to mark this as closed, If you are still seeing this issue let me know and we can open it again. |
Describe the bug
I'm trying to use arrow function in some expressions (I want to filter elements of my previous node) but I always get an error.
I tried to reproduce it in a Function node.
error: "Expression is not valid: Malformed arrow function parameter list"
it doesn't work for anonymous function either
error: "Expression is not valid: missing ) after argument list"
I thought it was related to the riot template engine, but I have not the problem executing those expressions in a standalone riot template installation.
To Reproduce
Run this node:
Expected behavior
The Function node should returns
instead it raises an error
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: