Description
On current master, getNonEDOFrequency() throws in a browser because it references Node’s global object. Browser scripts do not provide global, so the helper fails instead of returning a preview frequency.
Relevant source:
https://github.com/sugarlabs/musicblocks/blob/master/js/utils/musicutils.js#L3966
Expected Behavior
getNonEDOFrequency() should return the preview frequency in a browser without referencing Node’s global object.
Screenshots
Not attached. A DevTools console screenshot showing the error below can be added after reproducing locally.
How to Reproduce
- Clone the repository and serve the current
master locally.
- Open it in Chrome.
- Load
utils/musicutils through RequireJS.
- Call:
getNonEDOFrequency(0, 4, "just intonation", "C major")
Console log Errors:
Uncaught ReferenceError: global is not defined
at getNonEDOFrequency (js/utils/musicutils.js:3967:15)
Environment:
- Operating System: Windows 11
- Browser: Chrome 151.0.7922.174
- Version of Software/Project: master (10fc68d)
Checklist
Description
On current
master,getNonEDOFrequency()throws in a browser because it references Node’sglobalobject. Browser scripts do not provideglobal, so the helper fails instead of returning a preview frequency.Relevant source:
https://github.com/sugarlabs/musicblocks/blob/master/js/utils/musicutils.js#L3966
Expected Behavior
getNonEDOFrequency()should return the preview frequency in a browser without referencing Node’sglobalobject.Screenshots
Not attached. A DevTools console screenshot showing the error below can be added after reproducing locally.
How to Reproduce
masterlocally.utils/musicutilsthrough RequireJS.Console log Errors:
Uncaught ReferenceError: global is not defined
at getNonEDOFrequency (js/utils/musicutils.js:3967:15)
Environment:
Checklist