Skip to content

Commit d2df154

Browse files
authoredMar 12, 2025··
fix(core): Avoid using structuredClone on node descriptions (#13832)
1 parent 0d7894f commit d2df154

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎packages/cli/src/load-nodes-and-credentials.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import type {
2626
IVersionedNodeType,
2727
INodeProperties,
2828
} from 'n8n-workflow';
29-
import { NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow';
29+
import { deepCopy, NodeConnectionType, UnexpectedError, UserError } from 'n8n-workflow';
3030
import path from 'path';
3131
import picocolors from 'picocolors';
3232

@@ -315,12 +315,11 @@ export class LoadNodesAndCredentials {
315315
this.types.nodes.filter((nodetype) => nodetype.usableAsTool === true);
316316

317317
for (const usableNode of usableNodes) {
318-
const description: INodeTypeBaseDescription | INodeTypeDescription =
319-
structuredClone(usableNode);
318+
const description = deepCopy(usableNode);
320319
const wrapped = this.convertNodeToAiTool({ description }).description;
321320

322321
this.types.nodes.push(wrapped);
323-
this.known.nodes[wrapped.name] = structuredClone(this.known.nodes[usableNode.name]);
322+
this.known.nodes[wrapped.name] = { ...this.known.nodes[usableNode.name] };
324323

325324
const credentialNames = Object.entries(this.known.credentials)
326325
.filter(([_, credential]) => credential?.supportedNodes?.includes(usableNode.name))

0 commit comments

Comments
 (0)
Please sign in to comment.