NekroDarkmoon / ammo-tracker-fvtt

MIT License
4 stars 5 forks source link

Not working at all #4

Closed ctbritt closed 3 years ago

ctbritt commented 3 years ago

Not seeing any chat message, no options, nothing. Getting this error in the f12 console:


Uncaught (in promise) TypeError: Cannot read property 'endTracking' of undefined
    at index.js:71
    at Function._call (foundry.js:194)
    at Function.callAll (foundry.js:153)
    at ClientDatabaseBackend.callback (foundry.js:9062)
    at foundry.js:9002
    at Array.map (<anonymous>)
    at ClientDatabaseBackend._handleDeleteDocuments (foundry.js:9002)
    at ClientDatabaseBackend._deleteDocuments (foundry.js:8912)
    at async Function.deleteDocuments (document.mjs:402)
    at async Combat.delete (document.mjs:463)
(anonymous) @ index.js:71
_call @ foundry.js:194
callAll @ foundry.js:153
callback @ foundry.js:9062
(anonymous) @ foundry.js:9002
_handleDeleteDocuments @ foundry.js:9002
_deleteDocuments @ foundry.js:8912
async function (async)
_deleteDocuments @ foundry.js:8903
delete @ backend.mjs:215
async function (async)
delete @ backend.mjs:212
deleteDocuments @ document.mjs:402
delete @ document.mjs:463
callback @ foundry.js:20505
submit @ foundry.js:20449
_onClickButton @ foundry.js:20412
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
NekroDarkmoon commented 3 years ago

That's a very interesting bug, it is caused by game.users.players containing an entry with a false character id.

NekroDarkmoon commented 3 years ago

Turns out it is caused by a player user not having selected a character. A quick fix would be to see which user hasn't selected one and select a character for them. I'll add a check and fix for it in the next update.

Avitale34 commented 3 years ago

It is not working for me either getting this error at the end of combat

index.js:71 Uncaught (in promise) TypeError: Cannot read property 'endTracking' of undefined at assets.forge-vtt.com/bazaar/modules/ammo-tracker-fvtt/0.1.2/index.js:71 at Function._call (eval at (assets.forge-vtt.com/bazaar/modules/lib-wrapper/1.8.0.0/lib-wrapper.js:1), :4:14) at Function.callAll (foundry.js:153) at ClientDatabaseBackend.callback (foundry.js:9062) at foundry.js:9002 at Array.map () at ClientDatabaseBackend._handleDeleteDocuments (foundry.js:9002) at ClientDatabaseBackend._deleteDocuments (foundry.js:8912) at async Function.deleteDocuments (common/abstract/document.mjs:402) at async Combat.delete (common/abstract/document.mjs:463)

NekroDarkmoon commented 3 years ago

It is not working for me either getting this error at the end of combat

index.js:71 Uncaught (in promise) TypeError: Cannot read property 'endTracking' of undefined at assets.forge-vtt.com/bazaar/modules/ammo-tracker-fvtt/0.1.2/index.js:71 at Function._call (eval at (assets.forge-vtt.com/bazaar/modules/lib-wrapper/1.8.0.0/lib-wrapper.js:1), :4:14) at Function.callAll (foundry.js:153) at ClientDatabaseBackend.callback (foundry.js:9062) at foundry.js:9002 at Array.map () at ClientDatabaseBackend._handleDeleteDocuments (foundry.js:9002) at ClientDatabaseBackend._deleteDocuments (foundry.js:8912) at async Function.deleteDocuments (common/abstract/document.mjs:402) at async Combat.delete (common/abstract/document.mjs:463)

Yeah, that's being caused by a user account not having selected a character.

NekroDarkmoon commented 3 years ago

You can check which user it is by pasting this in the console

game.users.players.map(({data: {character}}) => game.actors.get(character))

ctbritt commented 3 years ago

Turns out it is caused by a player user not having selected a character. A quick fix would be to see which user hasn't selected one and select a character for them. I'll add a check and fix for it in the next update.

Very strange because I'm logging in as the player and she has definitely claimed a character.

NekroDarkmoon commented 3 years ago

That's weird. I'll be able to provide an alternative to that limitation on Sunday/Monday.

Avitale34 commented 3 years ago

I got it working if all of the players have assigned characters, if one of them does not, all of them don't function properly.

NekroDarkmoon commented 3 years ago

Provided a fallback with V0.1.3