Sugar icon indicating copy to clipboard operation
Sugar copied to clipboard

can't use sugar or sugar-core npm modules if Sugar is already loaded globally on the page

Open bradgearon opened this issue 8 months ago • 0 comments

if I have Sugar loaded globally on a page and then try to use one of the modules sugar or sugar-core in one of my modules it throws an error:

TypeError: Cannot read properties of undefined (reading 'hasOwn') at ../node_modules/sugar/common/var/coreUtilityAliases.js (coreUtilityAliases.js:6:1)

this is because if core.js finds Sugar as existing on the global or window object it won't set the module.exports to anything

I have a pull request that will make it still set module.exports when it find's the existing Sugar module I will submit to close this issue

bradgearon avatar Jun 13 '24 16:06 bradgearon