Open dispossible opened 7 years ago
Just ran into the same problem when packaging Pathfinding using Rollup. The problem is that lastValidCoord
is not 'strict-mode' safe.
lastValidCoord is not defined
Whats up with this? Reading here it seems this issue was fixed? But it is still happening to me when trying to smoothen the path?
var newPath = PF.Util.compressPath(path);
works though, is there big difrence betwen compresed and smoothen path?
The pull request is still open, so this repo doesn't contain the fix yet. I doubt it ever will 😢
You can use my fork where I did merge the fix into master: https://github.com/rejhgadellaa/PathFinding.js/tree/master
Thanks, will check it out
In Util.js at line 167 in the
smoothenPath
function,lastValidCoord
is undefined. Which if running the script standalone wouldn't be an issue as js will add the variable to the window scope, however it causes my build to error when used with the webpack and babel preprocessors.I believe the fix for this is that variable should to be defined on line 145 along with the other scoped variables.