Skip to content

Commit 5f57f36

Browse files
authored
fix: Export JSInterface to window object to fix ReferenceError (#5674)
The constraints.js file expects JSInterface to be available as a global variable, but interface.js was only exporting it for CommonJS (module.exports) and not attaching it to the window object. This commit adds the window export following the same pattern used in export.js for Mouse and MusicBlocks classes. Fixes: Uncaught ReferenceError: JSInterface is not defined at constraints.js:23:1
1 parent cd58f16 commit 5f57f36

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

js/js-export/interface.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,3 +1810,7 @@ class JSInterface {
18101810
if (typeof module !== "undefined" && module.exports) {
18111811
module.exports = JSInterface;
18121812
}
1813+
1814+
if (typeof window !== "undefined") {
1815+
window.JSInterface = JSInterface;
1816+
}

0 commit comments

Comments
 (0)