foundryvtt / dnd5e

An implementation of the 5th Edition game system for Foundry Virtual Tabletop (http://foundryvtt.com).
MIT License
276 stars 177 forks source link

Combat.create causes system to throw error #3578

Closed Haxxer closed 2 weeks ago

Haxxer commented 2 weeks ago

If you run the following code in a scene:

await Combat.create({ sceneId: canvas.scene.id });

The following error is returned (though the combat is created):

foundry.js:21581 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'combatantId')
    at Combat5e._manageTurnEvents (foundry.js:21581:53)
    at Combat5e._onCreate (foundry.js:21419:10)
    at ClientDatabaseBackend.callback (foundry.js:13603:11)
    at foundry.js:13576:43
    at Array.map (<anonymous>)
    at #handleCreateDocuments (foundry.js:13576:33)

This happens with no modules active and on the latest version of D&D5e and on V11.

Haxxer commented 2 weeks ago

This is in fact a Foundry issue