dnd5e icon indicating copy to clipboard operation
dnd5e copied to clipboard

References to an Embedded Document when using fromUuidSync causes script crash

Open ShinyHobo opened this issue 5 months ago • 3 comments

Title

Foundry: 12.331 dnd5e: 3.3.1 midiQOL: 11.6.14.1

When attempting to utilize the "Add attack/damage buttons to item inventory list" option with NPC sheets specifically, the roll hook crashes:

Chat message WyM0ZBMYWbhPjwQn failed to render: Error: fromUuidSync was invoked on UUID '[any uuid]' which references an Embedded Document and cannot be retrieved synchronously.)

I fixed this by making _enrichChatCard async, awaiting it, and changing the relevant "Enriched roll flavor" section from const item = fromUuidSync(roll?.itemUuid); to const item = await fromUuid(roll?.itemUuid);

This is a related issue to https://github.com/foundryvtt/dnd5e/issues/3675; this may be an issue elsewhere.

ShinyHobo avatar Sep 09 '24 19:09 ShinyHobo