chore(warnings): format warning logs, add troubleshooting page
This commit is contained in:
@@ -39,7 +39,9 @@ export function useMarkerSymbol(type: MarkerType) {
|
||||
const symbolExists = MarkerSymbols.hasOwnProperty(type);
|
||||
|
||||
if (!symbolExists) {
|
||||
console.warn(`marker type "${type}" doesn't exist.`);
|
||||
console.warn(
|
||||
`[React Flow]: marker type "${type}" doesn't exist. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
||||
);
|
||||
return () => null;
|
||||
}
|
||||
|
||||
|
||||
@@ -106,12 +106,16 @@ const EdgeRenderer = (props: EdgeRendererProps) => {
|
||||
const targetPosition = targetHandle?.position || Position.Top;
|
||||
|
||||
if (!sourceHandle) {
|
||||
console.warn(`couldn't create edge for source handle id: ${edge.sourceHandle}; edge id: ${edge.id}`);
|
||||
console.warn(
|
||||
`[React Flow]: couldn't create edge for source handle id: ${edge.sourceHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!targetHandle) {
|
||||
console.warn(`couldn't create edge for target handle id: ${edge.targetHandle}; edge id: ${edge.id}`);
|
||||
console.warn(
|
||||
`[React Flow]: couldn't create edge for target handle id: ${edge.targetHandle}; edge id: ${edge.id}. Help: https://reactflow.dev/docs/guides/troubleshooting`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,9 @@ const NodeRenderer = (props: NodeRendererProps) => {
|
||||
const nodeType = node.type || 'default';
|
||||
|
||||
if (!props.nodeTypes[nodeType]) {
|
||||
console.warn(`Node type "${nodeType}" not found. Using fallback type "default".`);
|
||||
console.warn(
|
||||
`[React Flow]: Node type "${nodeType}" not found. Using fallback type "default". Help: https://reactflow.dev/docs/guides/troubleshooting`
|
||||
);
|
||||
}
|
||||
|
||||
const NodeComponent = (props.nodeTypes[nodeType] || props.nodeTypes.default) as ComponentType<WrapNodeProps>;
|
||||
|
||||
@@ -16,7 +16,7 @@ export function useNodeOrEdgeTypes(nodeOrEdgeTypes: any, createTypes: any): any
|
||||
const typeKeys = Object.keys(nodeOrEdgeTypes);
|
||||
if (shallow(typesKeysRef.current, typeKeys)) {
|
||||
console.warn(
|
||||
"React Flow: It looks like that you created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them."
|
||||
"[React Flow]: It looks like you have created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them. Help: https://reactflow.dev/docs/guides/troubleshooting"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user