Skip to content

Incompatibility with better roll tables module #40

@kakaroto

Description

@kakaroto

A user reached out about the compendium library not working. After investigating the issue, it turns out to be caused by the "Better Roll Tables" module being loaded.
The reason for that is because that module apparently creates a exports global variable, which will cause every UMD dependency and build to fail, because it would cause the js umd packages to be installed under exports["pkg"] instead of window["pkg"] making those classes unavailable.
This is what happens when we open the compendium library, it loads the vue dependency component which then gets set in exports["ForgeCompendiumBrowserVue"] instead of being a global variable on window, causing this failure:
image
and this effect:
image

There's two actions to do here:
1 - report the issue to that module developer, because I'm sure it will be affecting potentially many other modules that may depend on build umd files or external dependencies
2 - perhaps modify dlopen so that it checks for a exports variable and renames it or keeps track of the variables in it so that when a dependency is loaded, it can copy the new fields into globalThis.window
Possibly do the same thing for the define method if it exists. See UMD format and how it loads dependencies:
https://jameshfisher.com/2020/10/04/what-are-umd-modules/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions