Seems that is also (and most probably) could be just because some of your variables are undefined.
This error indicates that the code expects to have an object with a lengthSquared property, but that object was not present.
As far as I can see from this line of your code, you didn’t create the new Vector3 object - should be like
task.loadedMeshes[0]._children[1].scaling = new BABYLON.Vector3(1000,1000,1000);
If you don’t want to create new object, you may use 3 lines of code, one for every axis: task.loadedMeshes[0]._children[1].scaling.x = 1000; task.loadedMeshes[0]._children[1].scaling.y = 1000; task.loadedMeshes[0]._children[1].scaling.z = 1000;