-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[WİP]test: added the requireStack to loader.js #46586
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RSLGTM👍
lib/internal/modules/cjs/loader.js
Outdated
@@ -451,15 +451,17 @@ function tryPackage(requestPath, exts, isMain, originalPath) { | |||
err.code = 'MODULE_NOT_FOUND'; | |||
err.path = path.resolve(requestPath, 'package.json'); | |||
err.requestPath = originalPath; | |||
// TODO(BridgeAR): Add the requireStack as well. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The requireStack
must be added to this error. That does not seem to be addressed here?
lib/internal/modules/cjs/loader.js
Outdated
const jsonPath = path.resolve(requestPath, 'package.json'); | ||
process.emitWarning( | ||
`Invalid 'main' field in '${jsonPath}' of '${pkg}'. ` + | ||
'Please either fix that or report it to the module author', | ||
'DeprecationWarning', | ||
'DEP0128', | ||
{ requireStack }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not certain what the intent here is. The warning seems independent from the TODO entry above?
Like Module._findPath and we think that changing the args list of this function will probably break some userspace packages. Do you have any comments on this? ❤️ @BridgeAR @anonrig 🎸 update : In the code block below, when the tryExtensions() function returns false, in the part where tryExtensions() is tried again with another parameter combination, I created a require stack when necessary |
// TODO(BridgeAR): Add the requireStack as well.
I also added the require stack @RaisinTen