fix(core): Avoid using structuredClone on node descriptions (#13832)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-03-12 13:21:36 +01:00
committed by GitHub
parent 0d7894f06a
commit d2df154b49

View File

@@ -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))