-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require.resolve.paths(${built-in module id}) returns null #18230
Labels
doc
Issues and PRs related to the documentations.
Comments
I think documenting |
nephross
added a commit
to nephross/node
that referenced
this issue
Jan 24, 2018
Update documentation of modules.md for require.resolve.paths() to include the possibillity of null as a return value if the request string given matches a core module name. Fixes: nodejs#18230
2 tasks
@cjihrig @jasnell @nephross @vsemozhetbyt Thanks. |
evanlucas
pushed a commit
that referenced
this issue
Jan 30, 2018
Update documentation of modules.md for require.resolve.paths() to include the possibillity of null as a return value if the request string given matches a core module name. PR-URL: #18350 Fixes: #18230 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins
pushed a commit
that referenced
this issue
Feb 27, 2018
Update documentation of modules.md for require.resolve.paths() to include the possibillity of null as a return value if the request string given matches a core module name. PR-URL: #18350 Fixes: #18230 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
MayaLekova
pushed a commit
to MayaLekova/node
that referenced
this issue
May 8, 2018
Update documentation of modules.md for require.resolve.paths() to include the possibillity of null as a return value if the request string given matches a core module name. PR-URL: nodejs#18350 Fixes: nodejs#18230 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When
require.resolve.paths()
receives a Node.js built-in module ID, for examplefs
andhttp2
, it doesn't returnArray<string>
butnull
.Is this an expected behavior? I'm OK with the current
null
returning behavior but we should inform this special case in the API document. Otherwise, if the original intent of #16397 is always retrievingArray<string>
as currently documented, we should fix the bug.For reference,
require.resolve
returns the ID itself when it takes one of the built-in module IDs.The text was updated successfully, but these errors were encountered: