-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
"node:" prefix #45001
Comments
This confirms an incorrect result as follows: |
fossamagna
added a commit
to fossamagna/node
that referenced
this issue
Oct 24, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: nodejs#45001
nodejs-github-bot
pushed a commit
that referenced
this issue
Nov 20, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
ruyadorno
pushed a commit
that referenced
this issue
Nov 21, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
marco-ippolito
pushed a commit
to marco-ippolito/node
that referenced
this issue
Nov 23, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: nodejs#45001 PR-URL: nodejs#45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams
pushed a commit
that referenced
this issue
Dec 30, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams
pushed a commit
that referenced
this issue
Dec 30, 2022
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams
pushed a commit
that referenced
this issue
Jan 3, 2023
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams
pushed a commit
that referenced
this issue
Jan 4, 2023
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
danielleadams
pushed a commit
that referenced
this issue
Jan 5, 2023
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
BethGriggs
pushed a commit
that referenced
this issue
Mar 27, 2023
require.resolve.paths should returns null with builtin module. when builtin module without `node:` schema, `paths` returns null. But, it don't return null when builtin module with `node:` schema. Fixes: #45001 PR-URL: #45147 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
node/lib/internal/modules/cjs/loader.js
Line 714 in 37e5152
Since the function does not check the built-in module "node:" prefix, unnecessary operations occur. It will directly return "null" if changed as follows;
( StringPrototypeStartsWith(request, 'node:') && BuiltinModule.canBeRequiredByUsers(StringPrototypeSlice(request, 5)) ) || ( BuiltinModule.canBeRequiredByUsers(request) && BuiltinModule.canBeRequiredWithoutScheme(request) )
The text was updated successfully, but these errors were encountered: