KayelGee / token-attacher

MIT License
11 stars 18 forks source link

Cannot read properties of undefined (reading 'hasOwnProperty') #72

Closed drenghel closed 1 year ago

drenghel commented 2 years ago

Foundry version 9 build 255 System: Starfinder: 0.18.2 Modules active: 41 Token Attacher: 4.4.3

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'hasOwnProperty')
[Detected 1 package: token-attacher]
    at Function._attachElementsToToken (token-attacher.js:1076)
    at async Function.attachElementsToToken (token-attacher.js:1054)
_attachElementsToToken @ token-attacher.js:1076
async function (async)
attachElementsToToken @ token-attacher.js:1054
(anonymous) @ token-attacher.js:1143
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2

Tittle is pretty self explanatory, whenever I try to use the module aka:

I don't really have the time to try with a more minimal setup, but I'll try later if you guys have no idea why the error appears

Cheers

KayelGee commented 2 years ago

Just to be sure because that's a mistake poeple new to the module have done before, the correct steps to attach a token to another token are:

drenghel commented 2 years ago

Good catch @KayelGee, I've tried many times to read the usage docs/fiddled around and still I was not able to make it work (to be clear, I just did as you said and it worked)

But I would argue that my issues stands, handling that particular misusage of the module just saying: Element already in chain of attachments. See console for more details. May be not the best way to communicate self linking :)

Especially to non tech savvy users (and I was supposed to be one and look how confused I still was :D)

Anyway thanks a bunch

KayelGee commented 2 years ago

I could add some more info in the console when this happens. Although I wonder why it threw an error in your case, as I was pretty sure I've caught them. I'll have to check this next time.