Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bradgearon opened this issue Jun 13, 2024 · 0 comments · May be fixed by #691
Open

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

bradgearon opened this issue Jun 13, 2024 · 0 comments · May be fixed by #691

Comments

@bradgearon
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant