erithtotl / wall-height

New fork of original project for continued improvements.
https://github.com/erithtotl/wall-height
GNU General Public License v3.0
6 stars 9 forks source link

Wall Height doesn't work when libwrapper isn't enabled #17

Open manuelVo opened 3 years ago

manuelVo commented 3 years ago

In Foundry 0.8.6, Wall Height 3.5.3.5 doesn't work if the libwrapper module isn't enabled, even though a libwrapper shim is included in Wall Height.

ruipin commented 3 years ago

This is because import {libWrapper} from '../shim.js'; is missing from the file patches.js. Instead, it looks like this line was added to wall-height.js, which does not use it.

As such, if libWrapper isn't active, the shim won't be used. Instead the script will search the global scope for libWrapper, and because it is undefined registering wrappers simply fails.

Note that in ESModules, files do not share scope. As such, the imported libWrapper symbol in wall-height.js is not visible from patches.js. Symbols need to be imported in every single file they are used in.

I recommend module devs always test modules that use the shim at least once before any release with libWrapper disabled, otherwise this kind of mistake can happen.