Skip to content

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

Open
@bradgearon

Description

@bradgearon

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions