From 02e55153e406b6a61904af6bff27dbae6151c3a2 Mon Sep 17 00:00:00 2001 From: moklick Date: Thu, 18 Jul 2024 13:35:45 +0200 Subject: [PATCH] chore(subflows): log warning instead of throwing an error #4455 --- packages/system/src/utils/store.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/system/src/utils/store.ts b/packages/system/src/utils/store.ts index 5a977cc0..3f08b0f7 100644 --- a/packages/system/src/utils/store.ts +++ b/packages/system/src/utils/store.ts @@ -104,8 +104,12 @@ function updateChildPosition( const parentId = node.parentId!; const parentNode = nodeLookup.get(parentId); + if (!parentNode) { - throw new Error(`Parent node ${parentId} not found`); + console.warn( + `[React Flow]: Parent node ${parentId} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.` + ); + return; } // update the parentLookup