You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Module.builtinModules should not include "inspector" when in a worker #22676
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.
Feel free to close when it lands. It's something to keep in mind for future additions though. Having to require the module in a try-catch isn't great (unintended code execution, gross-try-catch, etc.).
Update:
Do we know if the other case, !Connection, is covered by Module.builtinModules too?
Also, is there a reason why there are 'v8/*' and 'node-inspect/*' entries in require('module').builtinModules? Is this list not meant for public consumption? I would have expected only node core modules to be in there...
Activity
addaleax commentedon Sep 3, 2018
I’m not sure there’s much to do here, given that Workers are still experimental and #21364 is pretty close to landing.
jdalton commentedon Sep 3, 2018
Feel free to close when it lands. It's something to keep in mind for future additions though. Having to require the module in a try-catch isn't great (unintended code execution, gross-try-catch, etc.).
Update:
Do we know if the other case,
!Connection, is covered byModule.builtinModulestoo?mscdex commentedon Sep 3, 2018
Also, is there a reason why there are
'v8/*'and'node-inspect/*'entries inrequire('module').builtinModules? Is this list not meant for public consumption? I would have expected only node core modules to be in there...devsnek commentedon Sep 3, 2018
@mscdex anything that can be
require()ed is in the list. the v8 and node-inspect stuff was going to be separately deprecated.jdalton commentedon Sep 12, 2018
Related to #22769.
Trott commentedon Nov 21, 2018
I'm closing because #21364 landed. If that isn't right and this should remain open, by all means, correct my error and re-open this!