Aframe: commit 6deaea0 breaks aframe-physics-system.js with Cannot read property 'toUpperCase' of undefined

Created on 15 Oct 2018  路  10Comments  路  Source: aframevr/aframe

merge https://github.com/aframevr/aframe/pull/3772 breaks aframe-physics-system.js
with

Uncaught TypeError: Cannot read property 'toUpperCase' of undefined
at NewComponent.initBody (aframe-physics-system.js:15646)
at HTMLElement.module.exports.Object.create.emit.value (a-node.js:300)
at emitLoaded (a-node.js:131)

https://codesandbox.io/s/vv6jm1l06l

All 10 comments

This is the error I see: image

yes you are right i see this error in firefox too and the other error in chrome

Stepping through code here, this.data in the static-body component evaluates to a string, "true". Not sure why that should be happening though.. maybe something about how static-body is often used without any properties?

yeahh this fixed it thx! see static-body="" works https://codesandbox.io/s/52oq8zx7z4

Let鈥檚 keep this open, I think it鈥檚 a regression we鈥檒l want to fix.

Empty attributes are not supported in React, React (or aframe-react) fills it in with true. Provide a value. I also don't recommend React.

ok thx for the information! i have done some small test
https://codepen.io/anon/pen/qJGWJO?editors=0010

looks like react remove the attribute if its not set

@ngokevin can you describe, why it worked before the merge #3772 ?

Hard to say. It was a big change, but I think it is better that the error is present. It wasn't working before, something was just silently failing. This should never have worked:

screen shot 2018-10-29 at 5 27 46 pm

In other words, static-body and static-body="" should be allowed, but static-body="true" should not? And the first two are both working before and after this change? If so I'm fine with that.

Just checking to confirm that el.setAttribute('foo', '') still works, since that is fairly common.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huhsame picture huhsame  路  3Comments

rich311 picture rich311  路  3Comments

FranciscoPinho picture FranciscoPinho  路  3Comments

jgbarah picture jgbarah  路  4Comments

greggman picture greggman  路  4Comments