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

Issue when no cr found #37

Open
SamF111 opened this issue Jul 3, 2022 · 3 comments
Open

Issue when no cr found #37

SamF111 opened this issue Jul 3, 2022 · 3 comments

Comments

@SamF111
Copy link

SamF111 commented Jul 3, 2022

I've started getting this error after installing Baileywiki's latest modules, but I can't tell you if it's related.


Uncaught (in promise) TypeError: decoratedNpc.data is undefined
[Detected 1 package: compendium-browser]
    decorateNpc https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:1054
    loadAndFilterNpcs https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:673
    reduce https://[redacted].co.uk:500/common/utils/collection.mjs:168
    loadAndFilterNpcs https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:663
    promise callback*loadAndFilterNpcs https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:661
    renderItemData https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:833
    replaceList https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:806
    activateListeners https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js:357
    jQuery 2
[compendium-browser.js:1054:18](https://[redacted].co.uk:500/modules/compendium-browser/compendium-browser.js)

It's this line:
let cr = decoratedNpc.data.details?.cr;
I've patched it at my end with a terrible:
// cr display

        // cr display
		let cr = 0;
        try{
			cr = decoratedNpc.data.details?.cr; //0.7.2c: Possibly because of getIndex() use we now have to check for existence of details (doesn't for Character-type NPCs)
			}
		catch(e){
			console.log("Error in compendium browser with cr");
		}
@SamF111
Copy link
Author

SamF111 commented Jul 3, 2022

** that just moves the error, this handles it properly within your framework:
catch(e){return false;}

The modules causing the issue were:
Baileywiki Modular City - District 02: Docks
and
Baileywiki Nuts and Bolts

This does seem to set everything to cr 0, but at least it's workable with that module.

@SamF111
Copy link
Author

SamF111 commented Aug 17, 2022

In the latest version, I get this issue from another location:

compendium-browser.js:660 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'load')
[Detected 1 package: compendium-browser]
at CompendiumBrowser.loadAndFilterNpcs (compendium-browser.js:660:104)
at async CompendiumBrowser.renderItemData (compendium-browser.js:833:25)
at async CompendiumBrowser.replaceList (compendium-browser.js:806:38)

@joevaughan
Copy link

Note: Though this is an old issue, the latest version (0.8.1) should (theoretically) fix this. Can you check and close this issue if so please @SamF111 ?

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

No branches or pull requests

2 participants