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