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
repl.builtinModules doesn't contain all node.js builtin modules #57504
and notice how the modules printed in the first command are only a subset of those printed by the second
As you can see here:
How often does it reproduce? Is there a required condition?
It can be always reproduced and there is no required condition
What is the expected behavior? Why is that the expected behavior?
According to the REPL documentation (permalink) repl.builtinModules should contains a list of the names of all Node.js modules
What do you see instead?
Only a subset of the list
Additional information
(unless I'm mistaken) repl.builtinModules is basically just the same thing as the deprecated and removed repl._builtinLibs, in its deprecation note it is also stated that the list was incomplete
Modules not included in repl.builtinModules are available in the repl itself (e.g. node:test and node:sea)
(so it's not like repl.builtinModules includes only modules available in the repl)
The deprecation note does recommend to use require('node:module').builtinModules instead, so maybe repl.builtinModules should just be deprecated and removed?
changed the title [-]repl.builtinModules doesn't contain all node.js builtin modules[/-][+]`repl.builtinModules` doesn't contain all node.js builtin modules[/+]on Mar 16, 2025
The deprecation note does recommend to use require('node:module').builtinModules instead, so maybe repl.buildinModules should just be deprecated and removed?
The deprecation note does recommend to use require('node:module').builtinModules instead, so maybe repl.buildinModules should just be deprecated and removed?
SGTM, would you like to send a PR?
Yes for sure! I'll get to it right away, but could you clarify the plan here? is the idea to land this as a breaking change for v24 and leave it as is in v23?
Or if it makes sense I can fix and deprecating it in v23 and remove it altogether in v24, if that's not too much overhead
But I am not sure how to do that (2 PRs one for v23 and one for v24?) could you advice me on how to proceed in this regard? 🙂 🙏
Activity
[-]repl.builtinModules doesn't contain all node.js builtin modules[/-][+]`repl.builtinModules` doesn't contain all node.js builtin modules[/+]aduh95 commentedon Mar 16, 2025
SGTM, would you like to send a PR?
dario-piotrowicz commentedon Mar 16, 2025
Yes for sure! I'll get to it right away, but could you clarify the plan here? is the idea to land this as a breaking change for v24 and leave it as is in v23?
Or if it makes sense I can fix and deprecating it in v23 and remove it altogether in v24, if that's not too much overhead
But I am not sure how to do that (2 PRs one for v23 and one for v24?) could you advice me on how to proceed in this regard? 🙂 🙏
dario-piotrowicz commentedon Mar 16, 2025
Actually sorry it's my bad,
_builtinLibshas been deprecated but not actually removed:node/lib/repl.js
Lines 1871 to 1885 in ab9660b
So if we want to follow that I guess the correct solution here is to just deprecate
repl.builtinModulesinstead of remove it altogether, right? 🤔aduh95 commentedon Mar 16, 2025
The first step is to doc-deprecate it, you can check the history of
deprecations.mdfor examplesdario-piotrowicz commentedon Mar 16, 2025
@aduh95 thanks, done 🙂👍
Please have a look: #57508 🙏
PS: the PR is only deprecating the field, I can update the PR to also fix it (basically making it an alias to
module.builtinModules), should I? 🙂