Skip to content

Retry nested dynamic import links after evaluation - #8541

Merged
git-bruh merged 1 commit into
mainfrom
pkhanna/fix-new-module-registry
Nov 17, 2026
Merged

git-bruh merged 1 commit into
mainfrom
pkhanna/fix-new-module-registry

Conversation

@git-bruh

Copy link
Copy Markdown
Member

A dynamic import during module evaluation can reach a new graph that statically imports a module still being evaluated. The new module registry rejects that link instead of passing an evaluating module to V8, so the import fails with a circular dependency error.

When linking an uninstantiated target fails during module evaluation, retry linking and evaluation once from a microtask. Nested evaluation does not drain microtasks, so the retry runs after the current evaluation stack unwinds. Successful links still evaluate inline, and permanent link or evaluation errors reject the import.

Cover linking cycles, concurrent imports, top-level await, deferred link and evaluation errors, and synchronous require().

A dynamic import during module evaluation can reach a new graph that
statically imports a module still being evaluated. The new module
registry rejects that link instead of passing an evaluating module to
V8, so the import fails with a circular dependency error.

When linking an uninstantiated target fails during module evaluation,
retry linking and evaluation once from a microtask. Nested evaluation
does not drain microtasks, so the retry runs after the current
evaluation stack unwinds. Successful links still evaluate inline, and
permanent link or evaluation errors reject the import.

Cover linking cycles, concurrent imports, top-level await, deferred
link and evaluation errors, and synchronous require().
@git-bruh
git-bruh requested review from a team as code owners November 17, 2026 14:17

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — No issues found. The deferred retry is scoped to links that fail during module evaluation, handles termination correctly, and is well covered by tests and documentation.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

No issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No issues found.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 3d8df624

@git-bruh
git-bruh enabled auto-merge November 17, 2026 14:35
@git-bruh
git-bruh requested review from csjh and dcarney-cf November 17, 2026 16:35
@git-bruh
git-bruh merged commit 8803905 into main Nov 17, 2026
36 of 38 checks passed
@git-bruh
git-bruh deleted the pkhanna/fix-new-module-registry branch November 17, 2026 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants