Closed cyndra0 closed 2 years ago
Thanks for PRing the solution!
I ran into this conflict and was waiting for this change to land before updating my two.js version from 0.8.5
. In 0.8.8
I think I'm seeing the same or a similar issue.
Here I'm adding a Rectangle
to a Group
, the error seems to make it seem like a DOM element is expected.
Ah thanks, good eyes @endquote. This commit should fix that: https://github.com/jonobr1/two.js/commit/ccb29aa9a9b2dd798b1fd537ef89b496be522f6a
I'll do a soft update on npm to 0.8.9: https://www.npmjs.com/package/two.js/v/0.8.9
Yes, looks good now! 🎉
Describe the bug By definition, any kind of objects are extended from
Two.Element
, so it should be ok to give aText
to where asking for anElement
. But this call fails in v0.8.6:Environment (please select one):
Additional context When I peek the type definition I found that
Element
refers to the Element inlib.dom.d.ts
instead ofTwo.Element
. It turns out to be a name collision between two.js and dom. https://github.com/jonobr1/two.js/blob/7db7ba6be546f305cd63431941266c7b8a2e42c0/types.d.ts#L4103