Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot read properties of undefined (reading 'map') #17

Closed
p4535992 opened this issue Oct 24, 2024 · 4 comments · Fixed by #18
Closed

[BUG] Cannot read properties of undefined (reading 'map') #17

p4535992 opened this issue Oct 24, 2024 · 4 comments · Fixed by #18

Comments

@p4535992
Copy link

Details

Core Version: 12.331
System: dnd5e 4.0.4 (Atropos)
Modules:
forien-copy-environment v2.2.2 (Blair McMillan, Forien)
lib-wrapper 1.13.2.0 (Rui Pinheiro)
oronder 0.3.45 (Tuna)
permission_viewer 12.3 (Matheus Clemente)
tidy5e-sheet 6.2.0 (kgar, sednec#3813, p4535992)

Usage

when i click the "Manually Sync all Actors" i got this error:

oronder_bug

can you add a undefined check for this ?

@ChunkLightTuna
Copy link
Collaborator

@p4535992 what does this print?

game.actors.forEach(a=>a.items.filter(i=>i.hasAttack && i.type != 'consumable' && !('parts' in i.system.damage)).forEach(i=>console.log(i.name)))

@p4535992
Copy link
Author

VM11330:3 Scimitar
VM11330:3 Net
VM11330:3 Dart
VM11330:3 Hand Crossbow
VM11330:3 Dagger
VM11330:3 Scimitar
VM11330:3 Net
VM11330:3 Dart
VM11330:3 Hand Crossbow
foundry-esm.js:4621 Error: The `damage` property on `ActionTemplate` has been deprecated.
Deprecated since Version DnD5e 4.0
Backwards-compatible support will be removed in Version DnD5e 4.4
    at Object.logCompatibilityWarning (foundry-esm.js:4609:19)
    at SpellData.get (activities.mjs:349:25)
    at eval (eval at #executeScript (foundry.js:20082:16), <anonymous>:3:106)
    at EmbeddedCollection.filter (foundry-esm.js:5010:14)
    at eval (eval at #executeScript (foundry.js:20082:16), <anonymous>:3:33)
    at Actors.forEach (foundry-esm.js:5031:9)
    at Macro.eval (eval at #executeScript (foundry.js:20082:16), <anonymous>:3:14)
    at #executeScript (foundry.js:20087:17)
    at Macro.execute (foundry.js:20028:35)
    at Hotbar._onClickMacro (foundry.js:82722:20)
    at HTMLLIElement.dispatch (jquery.min.js:2:40035)
    at v.handle (jquery.min.js:2:38006)
logCompatibilityWarning @ foundry-esm.js:4621
get @ activities.mjs:349
eval @ VM11330:3
filter @ foundry-esm.js:5010
eval @ VM11330:3
forEach @ foundry-esm.js:5031
eval @ VM11330:3
#executeScript @ foundry.js:20087
execute @ foundry.js:20028
_onClickMacro @ foundry.js:82722
dispatch @ jquery.min.js:2
v.handle @ jquery.min.js:2
VM11330:3 Warhammer
VM11330:3 Light Crossbow
VM11330:3 Warhammer
VM11330:3 Light Crossbow

I'll put a json actor as example:
fvtt-Actor-zodrick-redclaw-nabrbIHdDMIM47ql.json

@ChunkLightTuna
Copy link
Collaborator

I should specify a max dnd5e version as I haven't moved on to 4 yet. In the meantime I'll shoot out a patch.

@ChunkLightTuna ChunkLightTuna linked a pull request Oct 24, 2024 that will close this issue
@p4535992
Copy link
Author

A ok actually I had started with a new world and the latest version of dnd5e, I didn't think about that thank you .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants