Skip to content
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

Document MODULE_NOT_FOUND #21894

Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,11 @@ unknown file extension.

Creation of a [`zlib`][] object failed due to incorrect configuration.

### MODULE_NOT_FOUND
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Should not this be ### ERR_MODULE_NOT_FOUND and be placed in a sorted way?
  2. It seems this doc does need <a id=... fragments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the actual error name is currently just MODULE_NOT_FOUND.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is the first error name out of the common name pattern?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is very unfortunate that this does not have the ERR_ prefix :-(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is 7 years old so we can't blame anyone for that : 3f987cd

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely needs to include the <a id="#MODULE_NOT_FOUND"></a> anchor


A module file could not be resolved while attempting a [`require`][] or
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[`require`][] -> [`require()`][]

`import` operation.

[`'uncaughtException'`]: process.html#process_event_uncaughtexception
[`--force-fips`]: cli.html#cli_force_fips
[`child_process`]: child_process.html
Expand Down Expand Up @@ -1886,3 +1891,4 @@ Creation of a [`zlib`][] object failed due to incorrect configuration.
[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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It seems this should be:
[`require()`]: modules.html#modules_require
  1. We usually sort bottom references ASCII-wise, so this need to be placed after the [`require('crypto').setEngine()`]: item.