node/lib/internal/modules/esm
Joyee Cheung fad773cede
module: throw error when re-runing errored module jobs
Re-evaluating an errored ESM should lead to rejecting
the rejection again - this is also the case when importing
it twice. In the case of retrying with
require after import, just throw the cached error.

Drive-by: add some debug logs.
PR-URL: https://github.com/nodejs/node/pull/58957
Backport-PR-URL: https://github.com/nodejs/node/pull/59504
Fixes: https://github.com/nodejs/node/issues/58945
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Refs: https://github.com/nodejs/node/issues/52697
2025-08-27 19:20:44 +02:00
..
assert.js
create_dynamic_module.js module: centralize SourceTextModule compilation for builtin loader 2024-08-08 15:02:52 +02:00
fetch_module.js lib: remove startsWith/endsWith primordials for char checks 2025-01-24 22:18:42 +01:00
formats.js
get_format.js module: implement the "module-sync" exports condition 2025-02-11 11:56:26 +01:00
hooks.js lib: reduce amount of caught URL errors 2025-02-11 11:55:58 +01:00
initialize_import_meta.js esm: add import.meta.dirname and import.meta.filename 2023-12-11 11:12:14 +00:00
load.js module: use kNodeModulesRE to detect node_modules 2025-02-11 11:56:39 +01:00
loader.js module: throw error when re-runing errored module jobs 2025-08-27 19:20:44 +02:00
module_job.js module: throw error when re-runing errored module jobs 2025-08-27 19:20:44 +02:00
module_map.js module: cache synchronous module jobs before linking 2025-02-11 11:55:49 +01:00
package_config.js
resolve.js lib: remove startsWith/endsWith primordials for char checks 2025-01-24 22:18:42 +01:00
shared_constants.js
translators.js module: refator ESM loader for adding future synchronous hooks 2025-02-11 11:56:29 +01:00
utils.js typings: fix ImportModuleDynamicallyCallback return type 2025-06-11 09:21:23 +02:00
worker.js module: prevent main thread exiting before esm worker ends 2025-01-24 22:18:54 +01:00