Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9e1fbb6

Browse filesBrowse files
joyeecheungrichardlau
authored andcommitted
esm: show race error message for inner module job race
The race can not only happen when the ESM is loaded by the CommonJS loader, but can also happen to inner module jobs in the dependency graph. PR-URL: #59519 Fixes: #59366 Refs: https://github.com/abejfehr/node-22.18-issue-repro Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent e2c9cab commit 9e1fbb6
Copy full SHA for 9e1fbb6

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/modules/esm/loader.js‎

Copy file name to clipboardExpand all lines: lib/internal/modules/esm/loader.js
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ class ModuleLoader {
462462
const resolvedImportAttributes = resolveResult.importAttributes ?? importAttributes;
463463
let job = this.loadCache.get(url, resolvedImportAttributes.type);
464464
if (job !== undefined) {
465+
// TODO(node:55782): this race may stop happening when the ESM resolution and loading become synchronous.
466+
if (!job.module) {
467+
assert.fail(getRaceMessage(url, parentURL));
468+
}
465469
// This module is being evaluated, which means it's imported in a previous link
466470
// in a cycle.
467471
if (job.module.getStatus() === kEvaluating) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.