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] HUD fails to appear due to undefined tooltipData #298

Open
jbrecht opened this issue Dec 11, 2024 · 2 comments
Open

[BUG] HUD fails to appear due to undefined tooltipData #298

jbrecht opened this issue Dec 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jbrecht
Copy link

jbrecht commented Dec 11, 2024

Describe the bug
The menus do not appear in one of my two games any more. The first time you click on a token, the following error appears in the console:

action-handler.js:1242 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'name')
[Detected 2 packages: token-action-hud-dnd5e(2.0.2), token-action-hud-core(2.0.10)]
    at #k (action-handler.js:1242:51)
    at action-handler.js:299:31

the code throwing the error is this:

    async #getTooltip(tooltipData) {
      if (this.tooltipsSetting === "none") return "";
      if (typeof tooltipData === "string") return tooltipData;

      const name = game.i18n.localize(tooltipData.name);

Specifically, it's tooltipData.name, tooltipData is undefined.

Steps to reproduce

  1. Launch Foundry
  2. Click on a token
  3. Observe no menus appear and the error mentioned above appears in the console.

Versions:

  • Token Action HUD Core: [2.0.10]
  • Token Action HUD System: [token-action-hud-dnd5e 2.0.2]
  • System: [dnd5e 4.1.2]
  • Foundry VTT: [12.331]
  • Browser: [Google Chrome 131.0.6778.109, Safari (not sure the version, just reported by a player.]

Additional context
This same configuration of versions is working for me in another Game World I have. Works consistently in one world while failing consistently in another.

@jbrecht jbrecht added the bug Something isn't working label Dec 11, 2024
@jbrecht jbrecht changed the title [BUG] [BUG] HUD fails to appear due to undefined tooltipData Dec 11, 2024
@jbrecht
Copy link
Author

jbrecht commented Dec 11, 2024

Followup - after setting the breakpoint and seeing the value of the tooltipData in the calls leading up to the problem were conditions, I checked on something. The world that was failing had the Combat Utility Belt module's "Enhanced Conditions" running. These conditions must be what breaks the HUD. the getTooltip function should probably just check for tooltipData being undefined and return "" in that case.

@MD25287
Copy link

MD25287 commented Jan 12, 2025

Followup - after setting the breakpoint and seeing the value of the tooltipData in the calls leading up to the problem were conditions, I checked on something. The world that was failing had the Combat Utility Belt module's "Enhanced Conditions" running. These conditions must be what breaks the HUD. the getTooltip function should probably just check for tooltipData being undefined and return "" in that case.

It is absolutely due to Combat Utility Belt. Disabling that module causes the Token HUD to reappear and work normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants