n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
45.04k stars 6.1k forks source link

"Edit Fields" node browser crash #10128

Open Nick-PDS opened 1 month ago

Nick-PDS commented 1 month ago

Bug Description

I am attempting to take an API response from an HTTP Requests (GET) node and reverse an array in a field called "data".

The way I am accomplishing that is by taking the "Edit Fields (Set)" node, using the "Manually Map" option, and dragging that field "data" from the scheme to the dropzone. It auto-fills based on the scheme, but once I start to type in .reverse() it crashes my browser and does not recover. I have to close the tab and open up a new one.

The input data HAS to exist for the node that is reversing the array. I have attempted to clear the test data I had and typed out the .reverse() and it worked and executed...but once I clicked back into that node when the input data existed, browser crashed. It seems to me like maybe it has something to do with the previewing area causing the crash since the execution works flawlessly.

To Reproduce

  1. Define an array called "data" in an "Edit Fields (Set)" node (not sure if populating the array or not causes the crash) (also not sure if the issue stems from the previous node being "HTTP Request" but the response is pretty standard from that of a standard REST API)
  2. Create another "Edit Fields (Set)" node after with the "Manually Map" option
  3. Using the scheme tab from the previous node, drag the "data" field into the dropzone so it autofills
  4. Execute the previous node the the input data exists
  5. At the end of $json["data"] type .reverse() and once you do the final parenthesis, browser should crash

Expected behavior

Not crash the browser when writing out ".reverse()" in the expression where an array is involved

Operating System

Ubuntu Linux 22.02

n8n Version

1.50.1

Node.js Version

20.15.0

Database

SQLite (default)

Execution mode

main (default)

netroy commented 1 month ago

Do you have a lot of data in the HTTP Requests node output?

Joffcom commented 1 month ago

Hey @Nick-PDS,

Thanks for the report, I took a quick look and have managed to reproduce it. I have created NODE-1517 as our internal ticket to fix this.

brandnewx commented 3 weeks ago

This is getting ridiculous when n8n is now trying to full full data into the editor. Now workflows that handle large data are no longer debuggable in the editor. Viewing previous executions take forever to load too. This is unbelievable.

Joffcom commented 3 weeks ago

Hey @brandnewx,

How much data are you loading at the moment and what does your workflow look like? We know there can be issues when loading hundreds of records in a workflow which is why we recommend using sub workflows as well which can help with some of this.

Sadly there is no quick fix to how the data is loaded in the browser and to keep the helpers there like resolving expressions but we are looking at ways to improve it.

brandnewx commented 3 weeks ago

Hey @brandnewx,

How much data are you loading at the moment and what does your workflow look like? We know there can be issues when loading hundreds of records in a workflow which is why we recommend using sub workflows as well which can help with some of this.

Sadly there is no quick fix to how the data is loaded in the browser and to keep the helpers there like resolving expressions but we are looking at ways to improve it.

Our workflows deal with binary data and base64 encoded json. That means just working with 10MB file is almost impossible without a fast connection. Why would I need to load the whole encoded data or binary data onto the editor?

netroy commented 3 weeks ago

can you please make sure that N8N_DEFAULT_BINARY_DATA_MODE is set to filesystem?