Skip to content

Open compedium generate error #1067

Description

@miczu2030

game.version: 13.347
game.system.version: 1.25.7
Recreate actions:

  1. clear system without any modules
  2. open compendiums
  3. open ironsworn assets
  4. error visible in console
  5. compedium is opened
    Error:
    foundry.mjs:23814 Error: Error thrown in hooked function '' for hook 'renderCompendium'. html.find is not a function [Detected 1 package: system:foundry-ironsworn(1.25.7)] at Hooks.onError (foundry.mjs:23813:24) at 🎁Hooks.onError#0 (libWrapper-wrapper.js:188:54) at #call (foundry.mjs:23795:36) at Hooks.callAll (foundry.mjs:23750:17) at #callHooks (foundry.mjs:27919:15) at #dispatchEvent (foundry.mjs:27903:36) at foundry.mjs:27876:26 at async #render (foundry.mjs:27210:5) at async #try (foundry.mjs:7154:17)Caused by: TypeError: html.find is not a function [Detected 1 package: system:foundry-ironsworn(1.25.7)] at Object.fn (drag-and-drop.ts:11:5) at #call (foundry.mjs:23791:20) at Hooks.callAll (foundry.mjs:23750:17) at #callHooks (foundry.mjs:27919:15) at #dispatchEvent (foundry.mjs:27903:36) at foundry.mjs:27876:26 at async #render (foundry.mjs:27210:5) at async #try (foundry.mjs:7154:17)

seams that error is generated insisde system/ironsworn.js:225108 by:

    function registerDragAndDropHooks() {
      Hooks.on("renderCompendium", (_app, html) => {
        html.find(".directory-item").on(
          "dragstart",
          (ev) => {
            const indexEntry = getIndexEntry(ev.target);
            CONFIG.IRONSWORN.emitter.emit("dragStart", indexEntry == null ? void 0 : indexEntry.type);
          }
        ).on(
          "dragend",
          (ev) => {
            const indexEntry = getIndexEntry(ev.target);
            CONFIG.IRONSWORN.emitter.emit("dragEnd", indexEntry == null ? void 0 : indexEntry.type);
          }
        );
      });
    }

error removed after correction to:

    function registerDragAndDropHooks() {
      Hooks.on("renderCompendium", (_app, html) => {
        const $html = html?.querySelector ? $(html) : html;
        $html.find(".directory-item").on(
          "dragstart",
          (ev) => {
            const indexEntry = getIndexEntry(ev.currentTarget ?? ev.target);
            CONFIG.IRONSWORN.emitter.emit("dragStart", indexEntry == null ? void 0 : indexEntry.type);
          }
        ).on(
          "dragend",
          (ev) => {
            const indexEntry = getIndexEntry(ev.currentTarget ?? ev.target);
            CONFIG.IRONSWORN.emitter.emit("dragEnd", indexEntry == null ? void 0 : indexEntry.type);
          }
        );
      });
    }

but has to be checked if it not generate other issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions