phetsims/vector-addition

Assertion failed: Should be a finite Vector2

Closed this issue · 3 comments

I'm seeing this error in master when returning a vector to its toolbox.

assert.js?bust=1572284237284:22 Uncaught Error: Assertion failed: Should be a finite Vector2
    at window.assertions.assertFunction (assert.js?bust=1572284237284:22)
    at VectorNode.setTranslation (Node.js?bust=1572284237467:2263)
    at VectorNode.set translation [as translation] (Node.js?bust=1572284237467:2272)
    at VectorNode.updateVector (RootVectorNode.js?bust=1572284237467:139)
    at RootVectorNode.js?bust=1572284237467:108
    at listener (Multilink.js?bust=1572284237467:41)
    at TinyEmitter.emit (TinyEmitter.js?bust=1572284237467:68)
    at DerivedProperty._notifyListeners (Property.js?bust=1572284237467:265)
    at DerivedProperty.set (Property.js?bust=1572284237467:176)
    at listener (DerivedProperty.js?bust=1572284237467:66)

Steps to reproduce:

  1. Start sim with ?ea
  2. Go to _Explore 1D` screen
  3. Drag vector 'a' from tool box, drop it on the graph.
  4. Drag vector 's' from graph, drop it on toolbox.

This also occurs in 1.0 branch with the same set of RC fixes, so it's probably one of those fixes that introduced this.

Bisecting shows that this bug was introduced in 35bfd34 for #250 (use rectangular pointer areas for vectors toolbox icons).

Fixed in master and 1.0 branches in the above commits. I've also associated these commits with related issue #250, so I'm going to close this issue. Not sure how this change happened, possibly because I was not on my usual development machine.