flamewave000 / dragonflagon-fvtt

DragonFlagon FoundryVTT Modules
BSD 3-Clause "New" or "Revised" License
64 stars 62 forks source link

DF Template Enhancements: MeasuredTemplate.prototype._getRectShape does not exist in v11.302 + D&D v2.2.1 #481

Open rafacrudi opened 1 year ago

rafacrudi commented 1 year ago

Module DF Template Enhancements

Bug Description LibWrapperPackageError: lib-wrapper. Error detected in module DF Template Enhancements. It is likely this module has not been updated for FVTT Version 11 Stable.

This is not a libWrapper bug.

Find information about this module here: https://github.com/flamewave000/dragonflagon-fvtt/tree/master/df-templates Report this issue here: https://github.com/flamewave000/dragonflagon-fvtt/issues

== Technical Details: Detected by libWrapper. Package ID= df-templates Error= Can't wrap 'MeasuredTemplate.prototype._getRectShape', target does not exist or could not be found.

[Detected 2 packages: lib-wrapper, df-templates] at new 🎁constructor (libWrapper-wrapper.js:111:11) at libWrapper-api.js:82:18 at de (libWrapper-api.js:155:9) at 🎁register [as register] (libWrapper-api.js:525:14) at SquareTemplate.patch (SquareTemplate.ts:21:14) at SquareTemplate.init (SquareTemplate.ts:17:19) at Object.fn (df-templates.ts:13:2) at #call (foundry.js:730:20) at Hooks.callAll (foundry.js:687:17) at Game.initialize (foundry.js:8573:11) at 🎁call_wrapped [as call_wrapped] (libWrapper-wrapper.js:507:22) at 🎁libWrapperInit (libWrapper-api.js:805:11) onError @ foundry.js:753 🎁call_wrapped @ libWrapper-wrapper.js:507 🎁Hooks.onError#lib-wrapper @ listeners.js:138 🎁Hooks.onError#0 @ libWrapper-wrapper.js:187

call @ foundry.js:734

callAll @ foundry.js:687 initialize @ foundry.js:8573 🎁call_wrapped @ libWrapper-wrapper.js:507 🎁libWrapperInit @ libWrapper-api.js:805 await in 🎁libWrapperInit (async)
🎁Game.prototype.initialize#0 @ libWrapper-wrapper.js:187 window.addEventListener.once @ foundry.js:90585

To Reproduce Just enabled the module.

InjustFr commented 1 year ago

I've looked into this and got a hacking fix if you want to fix your installation until the module is patched

In your modules folder in df-templates/src/main.js, change MeasuredTemplate.prototype._getRectShape by MeasuredTemplate.getRectShape and replace this._getRectShape by MeasuredTemplate.getRectShape

As of 11.302, shapes have moved to a private method with a public proxy method

EDIT: Fixed my answer as it was wrong and I didn't notice the console error

rafacrudi commented 1 year ago

Works! I mean, at least the console message is gone.

I'll lock my module until I see if this is included in future releases, just to avoid editing again.

Thank you!