MrPrimate / ddb-importer

Integrate your dndbeyond.com content into Foundry virtual tabletop
https://docs.ddb.mrprimate.co.uk/docs/intro
MIT License
201 stars 79 forks source link

Error on Monstermunch #355

Closed Gensokian closed 1 year ago

Gensokian commented 1 year ago

Describe the bug Trying to munch all dnd beyond Monsters will lead to X error messages, and 0 monsters imported. X being however many monsters are found on DNDBeyond

To Reproduce Steps to reproduce the behavior:

  1. Start a monster munch.
  2. Wait
  3. See it run into errors but saying "Finished importing 0 Monsters!"

Expected behavior The monsters get munched

Screenshots image

Environment:

Additional context Any other munch works (example vehicle munch in screenshot above)

Resetting the Compendiums does NOT fix the issue :/

After looking into it for about 10 seconds and giving up, I noticed inside "ddb-importer/dist/main.js:33344:22" it searches for the npcClass which is defined one line above. const npcClass = await Actor.create({ name, type: "npc" }, options);

Maybe its because somehow my instance noticed my german backend and tries to get the npc part ...{ name, type: "npc" }... as cha, for charakter (german)

Console Log

logger.js:83 DDB Importer | ERR > TypeError: Cannot read properties of undefined (reading 'toObject')
    at newNPC (https://***.******.com/james/modules/ddb-importer/dist/main.js:33344:22)
    at async DDBMonster.parse (https://***.******.com/james/modules/ddb-importer/dist/main.js:29093:26)
    at async DDBMonsterFactory.parse (https://***.******.com/james/modules/ddb-importer/dist/main.js:29344:9)
    at async DDBMonsterFactory.processIntoCompendium (https://***.******.com/james/modules/ddb-importer/dist/main.js:29398:26)
    at async DDBMuncher.parseCritters (https://***.******.com/james/modules/ddb-importer/dist/main.js:2293:22)
log @ logger.js:83
foundry.js:753 TypeError: undefined. Cannot read properties of undefined (reading 'cha')
[Detected 2 packages: system:dnd5e, ddb-importer]
    at NPCData._initialAbilityValue (common.mjs:55:70)
    at MappingField._getInitialValueForKey (fields.mjs:234:29)
    at MappingField.getInitialValue (fields.mjs:220:51)
    at MappingField.clean (commons.js:4977:46)
    at SchemaField._cleanType (commons.js:5302:28)
    at SchemaField.clean (commons.js:4983:19)
    at NPCData.cleanData (commons.js:6941:26)
    at TypeDataField.getInitialValue (commons.js:6576:19)
    at TypeDataField.clean (commons.js:4977:46)
    at SchemaField._cleanType (commons.js:5302:28)
    at SchemaField.clean (commons.js:4983:19)
    at Actor5e.cleanData (commons.js:6941:26)
    at Actor5e._initializeSource (commons.js:6928:31)
    at Actor5e._initializeSource (commons.js:9212:22)
    at Actor5e._initializeSource (actor.mjs:73:20)
    at new DataModel (commons.js:6804:21)
    at new ClientDocumentMixin (foundry.js:13909:7)
    at new Actor (foundry.js:18389:1)
    at new Actor5e (actor.mjs:11:16)
    at #preCreateDocumentArray (foundry.js:13468:15)
    at ClientDatabaseBackend._createDocuments (foundry.js:13362:73)
    at ClientDatabaseBackend.create (commons.js:8525:19)
    at async Actor.createDocuments (commons.js:7854:23)
    at async Actor.create (commons.js:7977:23)
    at async newNPC (monster.js:6:1)
    at async DDBMonster.parse (DDBMonster.js:171:1)
    at async DDBMonsterFactory.parse (DDBMonsterFactory.js:147:1)
    at async DDBMonsterFactory.processIntoCompendium (DDBMonsterFactory.js:201:1)
    at async DDBMuncher.parseCritters (DDBMuncher.js:242:1)
onError @ foundry.js:753
logger.js:83 DDB Importer | ERR > Failed parsing Zephyros

.....

logger.js:81 DDB Importer | ERR > Failed to parse (2668) ['"The Demogorgon"', 'Aarakocra', 'Aarakocra Simulacrum', 'Aarakocra Spelljammer', 'Aartuk Elder', 'Aartuk Starhorror', 'Aartuk Weedling', 'Abhorrent Overlord', 'Abjurer', 'Abjurer Wizard', 'Aboleth', 'Aboleth Spawn', 'Abominable Yeti', 'Abominable Yeti (Allowak variant)', 'Abyssal Chicken', 'Abyssal Wretch', 'Acererak', 'Acolyte', 'Adult Amethyst Dragon', 'Adult Black Dragon', 'Adult Blue Dracolich', 'Adult Blue Dragon', 'Adult Brass Dragon', 'Adult Bronze Dragon', 'Adult Copper Dragon', 'Adult Crystal Dragon', 'Adult Deep Dragon', 'Adult Emerald Dragon', 'Adult Gold Dragon', 'Adult Green Dragon', 'Adult Kruthik', 'Adult Kruthik', 'Adult Lunar Dragon', 'Adult Moonstone Dragon', 'Adult Oblex', 'Adult Oblex', 'Adult Red Dracolich', 'Adult Red Dragon', 'Adult Sapphire Dragon', 'Adult Silver Dragon', 'Adult Solar Dragon', 'Adult Topaz Dragon', 'Adult White Dragon', 'Aeorian Absorber', 'Aeorian Nullifier', 'Aeorian Reverser', 'Aerisi Kalinoth', 'Agdon Longscarf', 'Agony the Ghost', 'Ahmaergo', 'Air Elemental', 'Air Elemental Myrmidon', 'Air Elemental Myrmidon', 'Akroan Hoplite', 'Alagarthas', 'Albino Dwarf Spirit Warrior', 'Albino Dwarf Warrior', 'Aldani (Lobsterfolk)', 'Alhoon', 'Alhoon', 'Alkilith', 'Alkilith', 'Allip', 'Allip', 'Allosaurus', 'Almiraj', 'Alseid', 'Alyxian Aboleth', 'Alyxian the Absolved', 'Alyxian the Callous', 'Alyxian the Dispossessed', 'Alyxian the Hunter', 'Alyxian the Tormented', 'Amarith Coppervein', 'Amble', 'Ambush Drake', 'Amethyst Dragon Wyrmling', 'Amethyst Greatwyrm', 'Amidor the Dandelion', 'Ammalia Cassalanter', 'Amnizu', 'Amnizu', 'Amnizu (Summoner Variant)', 'Amnizu (Summoner Variant)', 'Amphisbaena', 'Amphisbaena (Monstrosity)', 'Amrik Vanthampur', 'Anarch', 'Anchorite of Talos', 'Ancient Amethyst Dragon', 'Ancient Black Dragon', 'Ancient Blue Dragon', 'Ancient Brass Dragon', 'Ancient Bronze Dragon', 'Ancient Construct', 'Ancient Copper Dragon', 'Ancient Crystal Dragon', 'Ancient Deep Crow', 'Ancient Deep Dragon', 'Ancient Dragon Turtle', …]
Gensokian commented 1 year ago

So I tried multiple things:

Reset Languages (Failed) Reset Cobalt Token (failed) Reset Cookies / Browser settings (failed) Different browser - Edge (failed) Different Browser - Firefox (Failed)

what DID work is creating a new world and re-downloading all monsters.... uhoh

MrPrimate commented 1 year ago

This might indicate something odd with that world. maybe from a conflicting module or bad setting. Was this world upgraded from v10? If so it's worth noting that you can't currently update existing things in DDB Importer due to this core foundry bug in v11 https://github.com/foundryvtt/foundryvtt/issues/9552

Gensokian commented 1 year ago

Yes, this was updated from V10. But it also happens when completely nuking all compendiums that DDB-importer has created and completely fresh-install DDBI, thus re-creating the DDB Compendiums

Also it is not a module conflict, since all modules disabled bring the same issue.

MrPrimate commented 1 year ago

As it can't be replicated in a new world there is not much I can do to attempt to fix your issue.

Gensokian commented 1 year ago

Alright, thanks anyways