Files
node/lib/internal
Joyee Cheung 3ceda2a035 module: handle cached linked async jobs in require(esm)
This handles two cases caused by using Promise.all() with
multiple dynamic import() that can make an asynchronously
linked module job that has finished/failed linking but
has not yet started actual evaluation appear in the load
cache when another require request is in turn to handle
it.

- When the cached async job has finished linking but has not
  started its evaluation because the async run() task would be
  later in line, start the evaluation from require() with
  runSync().
- When the cached async job have already encountered a linking
  error that gets wrapped into a rejection, but is still later
  in line to throw on it, just unwrap and throw the linking error
  from require().

PR-URL: https://github.com/nodejs/node/pull/57187
Fixes: https://github.com/nodejs/node/issues/57172
Refs: https://github.com/shufo/prettier-plugin-blade/issues/311
Refs: https://github.com/fisker/prettier-plugin-blade-311
Refs: https://github.com/mochajs/mocha/issues/5290
Refs: https://github.com/JoshuaKGoldberg/repros/tree/mocha-missing-module-cyclic
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-04-17 10:51:19 -03:00
..
2024-11-27 11:03:39 -05:00
2024-10-04 10:20:24 +02:00
2024-11-27 11:03:39 -05:00
2024-09-12 11:06:49 +02:00
2024-04-29 22:46:31 +02:00
2024-11-27 11:03:39 -05:00
2024-11-27 11:03:39 -05:00
2024-10-04 10:20:24 +02:00
2025-04-17 10:51:13 -03:00
…
2025-01-05 12:57:35 -05:00
2024-10-04 10:20:24 +02:00
2024-08-30 15:52:14 -03:00
2024-02-19 01:19:44 +00:00

Internal Modules

The modules located in lib/internal directory are exclusively meant for internal usage within the Node.js core. They are not intended to be accessed via user modules require(). These modules may change at any point in time. Relying on these internal modules outside the core is not supported and can lead to unpredictable behavior.

In certain scenarios, accessing these internal modules for debugging or experimental purposes might be necessary. Node.js provides the --expose-internals flag to expose these modules to userland code. This flag only exists to assist Node.js maintainers with debugging internals. It is not meant for use outside the project.