Skip to content

Module.builtinModules should not include "inspector" when in a worker #22676

@jdalton

Description

@jdalton

The recommended way to sniff for "inspector" support without using process.binding() has been to use Module.builtinModules. However, when in a worker the Module.builtinModules array still contains "inspector" resulting in an error being thrown when the module is required.

node/lib/inspector.js

Lines 17 to 18 in e570ae7

if (!Connection || !require('internal/worker').isMainThread)
throw new ERR_INSPECTOR_NOT_AVAILABLE();

Metadata

Metadata

Assignees

No one assigned

    Labels

    inspectorIssues and PRs related to the V8 inspector protocolworkerIssues and PRs related to Worker support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions