fix(eval): load ESM import edges asynchronously (#385)
* fix(eval): load external import edges asynchronously When a broker-fallback barrel is linked in a vm.SourceTextModule, synchronously requiring an ESM child can trigger Node's status-0 assertion. Pass the resolution kind into the external loader and use import() for import and dynamic-import edges, while preserving require for JSON and native assets. Add a dual-package barrel regression fixture that fails with the original Unexpected module status 0 error. Co-authored-by: Codex <noreply@openai.com> * test(cli): remove obsolete require fallback assertion The evaluator now loads import edges with import(), so this CLI integration test should assert successful extraction rather than the old fallback diagnostic. Co-authored-by: Codex <noreply@openai.com> * Keep eval.require meaningful and CJS exports intact when loading externals async Switching `import`-edge externals to import() is needed — the require() that trips "Unexpected module status 0" also poisons the entry for any later import(), so it cannot be retried — but doing it unconditionally routed every CommonJS dependency around eval.require and around require()'s runtime export enumeration. Reuse the require-policy check on the new path and read module.exports back out of the CJS cache so dynamically assigned exports stay importable, which also lets the CLI keep asserting the require-fallback diagnostic. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix(eval): preserve builtin import handling Keep Node builtin imports on the runner's existing require path so eval.require does not classify them as runtime fallback dependencies. Add a regression covering a custom-resolved node:path import with eval.require='error'. Co-authored-by: Codex <noreply@openai.com> * fix(eval): resolve bare external imports from importer --------- Co-authored-by: Codex <noreply@openai.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Anton Evzhakov <anton@evz.name>
S
Steve Hart committed
2898739d285b2d090b50aa6551d232dc785330b5
Parent: 8b0e7f0
Committed by GitHub <noreply@github.com>
on 8/20/2026, 9:46:51 AM