diff --git a/.changeset/short-dingos-return.md b/.changeset/short-dingos-return.md new file mode 100644 index 00000000..75cde9d4 --- /dev/null +++ b/.changeset/short-dingos-return.md @@ -0,0 +1,5 @@ +--- +'@xyflow/system': patch +--- + +Use the handle id of the matching handle type when warning about an edge that can't be created due to missing handle ids. diff --git a/packages/system/src/constants.ts b/packages/system/src/constants.ts index 9f5c63a5..e108b761 100644 --- a/packages/system/src/constants.ts +++ b/packages/system/src/constants.ts @@ -16,7 +16,7 @@ export const errorMessages = { { id, sourceHandle, targetHandle }: { id: string; sourceHandle: string | null; targetHandle: string | null } ) => `Couldn't create edge for ${handleType} handle id: "${ - !sourceHandle ? sourceHandle : targetHandle + handleType === 'source' ? sourceHandle : targetHandle }", edge id: ${id}.`, error010: () => 'Handle: No node id found. Make sure to only use a Handle inside a custom Node.', error011: (edgeType: string) => `Edge type "${edgeType}" not found. Using fallback type "default".`,