node/lib/internal/modules
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
..
cjs module: handle .mjs in .js handler in CommonJS 2025-08-27 19:20:42 +02:00
esm module: throw error when re-runing errored module jobs 2025-08-27 19:20:44 +02:00
helpers.js module: implement the "module-sync" exports condition 2025-02-11 11:56:26 +01:00
package_json_reader.js module: move helpers out of cjs loader 2023-11-11 19:37:47 +01:00
run_main.js module: unflag detect-module 2025-02-11 11:56:12 +01:00