From d2df154b49ad4e89ac1b5e5b1b49df57a377175e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 12 Mar 2025 13:21:36 +0100 Subject: [PATCH] fix(core): Avoid using structuredClone on node descriptions (#13832) --- packages/cli/src/load-nodes-and-credentials.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/load-nodes-and-credentials.ts b/packages/cli/src/load-nodes-and-credentials.ts index 947a03a25d..c45bd0642a 100644 --- a/packages/cli/src/load-nodes-and-credentials.ts +++ b/packages/cli/src/load-nodes-and-credentials.ts @@ -26,7 +26,7 @@ import type { IVersionedNodeType, INodeProperties, } from 'n8n-workflow'; -import { NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow'; +import { deepCopy, NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow'; import path from 'path'; import picocolors from 'picocolors'; @@ -315,12 +315,11 @@ export class LoadNodesAndCredentials { this.types.nodes.filter((nodetype) => nodetype.usableAsTool === true); for (const usableNode of usableNodes) { - const description: INodeTypeBaseDescription | INodeTypeDescription = - structuredClone(usableNode); + const description = deepCopy(usableNode); const wrapped = this.convertNodeToAiTool({ description }).description; this.types.nodes.push(wrapped); - this.known.nodes[wrapped.name] = structuredClone(this.known.nodes[usableNode.name]); + this.known.nodes[wrapped.name] = { ...this.known.nodes[usableNode.name] }; const credentialNames = Object.entries(this.known.credentials) .filter(([_, credential]) => credential?.supportedNodes?.includes(usableNode.name))