Smart edges don't work as intended with vite
Describe the Bug
After switching to vite, the SmartBezierEdge edges don't work as intended.
Findings:
I attempted to install the most basic setup with and without vite.
I tried using React dev tools to see if there were any noticeable differences.
I found that when moving the nodes around, the vite project's SmartEdge children would alternate between:
SmartEdge > BaseEdgeSmartEdge > BezierEdge > BaseEdge
In the cra project, the SmartEdge children stayed as:
SmartEdge > BaseEdge
Minimal Example
https://github.com/johnmal-dev/react-flow-vite
Steps to Reproduce the Bug or Issue
- Move node around
- Observe edge colliding with nodes
Expected behavior
I expect the edges to avoid collisions
Screenshots or Videos
Platform
- OS: macOS
- Browser: Chrome
- Version: 3.0.0
Additional context
No response
@johnmal-dev I was running into this same issue and looked into it more.
It seems that the pathfinding package that this library uses errors when trying to use smoothenPath function.
I get the error ReferenceError: assignment to undecalred variable lastValidCoord: smoothenPath Util.js:167
when I look at the code there, they don't declare the variables with var, let, or const so it is errors.
But this error only happens in dev mode, if you make a production build, it will ignore it and work.
Definitely annoying but this is a bug on the pathfinding package and not this one.
I am assuming CRA ignores these errors in dev as well.
@kthyer @johnmal-dev Version 4 does not use pathfinding anymore