jopeek / fvtt-loot-sheet-npc-5e

FVTT - Loot Sheet NPC 5E
MIT License
44 stars 85 forks source link

entity.js import fails when running foundry with non-default route prefix #368

Open proarunas opened 1 year ago

proarunas commented 1 year ago

Describe the bug References to "entity.js" use absolute paths. When the foundry is configured to use route prefixes, the imports fail. References to "npcs.js" already use relative paths, so the same fix should be applied to "entity.js" imports.

To Reproduce

  1. Edit foundry options to use some route prefix in "Data/Config/options.json".
  2. Launch a world that has LooSheetNpc5e enabled.
  3. Check the browser console to see that it can't find the entity.js.

Expected behavior The module should work with non-default prefixes.

mkemp commented 1 year ago

Running into the same issue. When looking at the source in the browser for lootsheetnpc5e.js:

import e from "../../systems/dnd5e/module/actor/sheets/npc.js";
import t from "../../../../../../systems/dnd5e/module/item/entity.js";

If I manually fix the installed module to the following everything works as expected:

import e from "../../systems/dnd5e/module/actor/sheets/npc.js";
import t from "../../systems/dnd5e/module/item/entity.js";
proarunas commented 1 year ago

That was my initial fix as well. (it's for Data/modules/lootsheetnpc5e/lootsheetnpc5e.json if anyone else is wondering.)

Added a pull request for the build to generate the file that way, to begin with.