This module-scope instance would become one instance per handler
The message
MARKLESS_MODULE_INSTANCE_DIVERGENT_HANDLERS: Module-scope instance "<name>" is carried into <length> handler modules (<symbolIds>). Each of those modules runs its own constructor, so they hold <length> separate instances and anything one of them records is invisible to the others.
Every handler symbol module is loaded on its own when its handler first fires, so a declaration in the authoring file has to be copied into each one that names it. One handler gets the intended browser-side instance. Two or more get a copy each, and nothing at runtime reveals that they have drifted apart.
Move "<name>" and its class into their own module and import it. An import resolves to one module instance that every handler module shares, so the handlers agree.
https://markless.dev/errors/MARKLESS_MODULE_INSTANCE_DIVERGENT_HANDLERSWords in angle brackets change from case to case.
Why
Every handler symbol module is loaded on its own when its handler first fires, so a declaration in the authoring file has to be copied into each one that names it. One handler gets the intended browser-side instance. Two or more get a copy each, and nothing at runtime reveals that they have drifted apart.
Fix
Move "<name>" and its class into their own module and import it. An import resolves to one module instance that every handler module shares, so the handlers agree.
Related
Where Markless raises it
Button sounds are from Josh Comeau's Button Sounds library.