Skip to content
Merged
Changes from 1 commit
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
5 changes: 3 additions & 2 deletions lib/internal/modules/esm/translators.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ function loadCJSModule(module, source, url, filename, isMain) {
specifier = `${pathToFileURL(path)}`;
}

// FIXME(node:59666) Currently, the ESM loader re-invents require() here for imported CJS and this
// requires a separate cache to be populated as well as introducing several quirks. This is not ideal.
// NOTE: This re-invented require() is only used on the loader-hook worker thread.
// On the main thread, the authentic require() is used instead (fixed by #60380).
// Remaining quirks on the loader-hook thread: lacks require.cache, require.extensions.
Comment thread
karan-lrn marked this conversation as resolved.
Outdated
const request = { specifier, attributes: importAttributes, phase: kEvaluationPhase, __proto__: null };
const job = cascadedLoader.getOrCreateModuleJob(url, request, kRequireInImportedCJS);
job.runSync();
Expand Down