Skip to content

Conversation

@samuelhnrq
Copy link

@samuelhnrq samuelhnrq commented Jul 4, 2025

Importing an ESM module with a top level error through require(esm) leaves the ESM load cache in a somewhat broken state, causing future import(esm) calls fail silently and not propagate the original error. For more context please see #58945

Adds testing to make ensure top level errors thrown during ESM module
import/evaluation get preserved on subsequent attempts to load the same
module again no matter if require(esm) or import(esm)

Refs: nodejs#58945
@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Jul 4, 2025
@samuelhnrq
Copy link
Author

closed in favor of #58957

@samuelhnrq samuelhnrq closed this Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants