Bug Report: Sort Node Fails with Sort by number in "Simple" mode, while in code mode sometimes randomly giving "Sort code doesn't return" Error for my code! #12391
Labels
in linear
Issue or PR has been created in Linear for internal review
Bug Description
The Sort node occasionally fails with the Simple and with the Code mode giving error:
"Sort code doesn't return. Please add a 'return' statement to your code."
This occurs despite having an explicit return statement in the custom sort code. The issue may be due to edge cases in the provided JavaScript code or internal node handling.
Screenshots
Workflow Example
Here is a minimal reproducible workflow:
To Reproduce
Steps to Reproduce (Code Mode)
name
field, formatted as<number>_filename
(e.g.,123_file.txt
).On Simple mode just use same mode with cancelling the code mode to Simple.
Expected behavior
I should use Simple mode and it sort the items by numbers
1_
2_
3_
etc...
Operating System
docker (self-hosted)
n8n Version
1.73.1
Node.js Version
20.18.0
Database
PostgreSQL
Execution mode
main (default)
The text was updated successfully, but these errors were encountered: