Skip to content

util.deprecate causes a stack overflow in browser #11

Closed
@bernardmcmanus

Description

@bernardmcmanus

When util.js is bundled with browserify and run in browser, util.deprecate falls into an infinite loop here because process is not namespaced to global - it's only global within the context of the browserify bundle.

I can see where this would fall to @substack considering this deviates from the node environment, but I can also see why they would not want to set window.process from within a bundle. Checking typeof process rather than isUndefined(global.process) would be a simple solution.

Regardless, the --no-deprecation check should occur first to provide a way to avoid this.

Demo here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions