TypeError: Cannot read properties of undefined (reading 'length') - Physics
Closed this issue · 2 comments
kyllerss commented
A number of Physics commands cause the following error:
TypeError: Cannot read properties of undefined (reading 'length')
at base.Function (walk.mjs:298:48)
at c (walk.mjs:52:22)
at base.FunctionDeclaration (walk.mjs:282:60)
at c (walk.mjs:52:22)
at Object.skipThrough (walk.mjs:194:37)
at c (walk.mjs:52:22)
at base.NewExpression.base.CallExpression (walk.mjs:403:9)
at c (walk.mjs:52:22)
at Object.skipThrough (walk.mjs:194:37)
at c (walk.mjs:52:22)
You can see the ones that are failing by going to https://kidjs.org/physics:
- anchored
- push
- acceleration
- collision
Great framework! Looking forward to seeing what my kid can do with it!
cmaissan commented
Thanks for bringing that to my attention. The issue was actually unrelated to the physics, but to passing an expression as a parameter to the "on" method. (Regardless, it has been fixed!)
I've also removed the acceleration property from the framework. There isn't really a need to apply constant acceleration and it was just creating confusion. Docs have now been updated.
Cheers,
Chris
kyllerss commented
Thank you!