Document MODULE_NOT_FOUND#21894
Document MODULE_NOT_FOUND#21894DullReferenceException wants to merge 6 commits intonodejs:masterfrom
Conversation
Document `MODULE_NOT_FOUND` as a possible `code` for errors.
doc/api/modules.md
Outdated
| [`module` object][]. In particular, `module.exports` is used for defining what | ||
| a module exports and makes available through `require()`. | ||
|
|
||
| <a id="require"></a> |
There was a problem hiding this comment.
This isn't necessary as the html generator for the markdown will create these id attributes automatically.
doc/api/errors.md
Outdated
| [try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch | ||
| [vm]: vm.html | ||
| [WHATWG Supported Encodings]: util.html#util_whatwg_supported_encodings | ||
| [`require`]: modules.html#require |
There was a problem hiding this comment.
The right-hand side of this should be modules.html#modules_require instead.
doc/api/errors.md
Outdated
| [try-catch]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch | ||
| [vm]: vm.html | ||
| [WHATWG Supported Encodings]: util.html#util_whatwg_supported_encodings | ||
| [`require`]: modules.html#modules_require |
There was a problem hiding this comment.
- It seems this should be:
[`require()`]: modules.html#modules_require- We usually sort bottom references ASCII-wise, so this need to be placed after the
[`require('crypto').setEngine()`]:item.
|
|
||
| Creation of a [`zlib`][] object failed due to incorrect configuration. | ||
|
|
||
| ### MODULE_NOT_FOUND |
There was a problem hiding this comment.
- Should not this be
### ERR_MODULE_NOT_FOUNDand be placed in a sorted way? - It seems this doc does need
<a id=...fragments.
There was a problem hiding this comment.
I believe the actual error name is currently just MODULE_NOT_FOUND.
There was a problem hiding this comment.
So this is the first error name out of the common name pattern?
doc/api/errors.md
Outdated
|
|
||
| ### MODULE_NOT_FOUND | ||
|
|
||
| A module file could not be resolved while attempting a [`require`][] or |
There was a problem hiding this comment.
[`require`][] -> [`require()`][]
|
Leaving the added anchor in errors.md is fine for consistency, I honestly do not know why they are being explicitly added in that file, even after looking at the original PR where the first documented errors were added. /cc @jasnell |
|
The anchors are added to explicitly ensure that the exact error code can be used as an anchor in the docs rather than the anchor generated by the markdown rendering... e.g. |
| Creation of a [`zlib`][] object failed due to incorrect configuration. | ||
|
|
||
| [`'uncaughtException'`]: process.html#process_event_uncaughtexception | ||
| ### MODULE_NOT_FOUND |
There was a problem hiding this comment.
It is very unfortunate that this does not have the ERR_ prefix :-(
There was a problem hiding this comment.
The code is 7 years old so we can't blame anyone for that : 3f987cd
| Creation of a [`zlib`][] object failed due to incorrect configuration. | ||
|
|
||
| [`'uncaughtException'`]: process.html#process_event_uncaughtexception | ||
| ### MODULE_NOT_FOUND |
There was a problem hiding this comment.
This definitely needs to include the <a id="#MODULE_NOT_FOUND"></a> anchor
|
Landed in 87f7671 |
Document MODULE_NOT_FOUND
Checklist
Document
MODULE_NOT_FOUNDas a possiblecodefor errors.Fixes: #21890