Skip to content

Conversation

@mxxk
Copy link

@mxxk mxxk commented Oct 2, 2025

Recent Node.js versions throw ERR_REQUIRE_ASYNC_MODULE instead of ERR_REQUIRE_ESM if require() is used to import a module with top-level await.

Minimal reproduction: https://github.com/mxxk-examples/migrate-mongo-async-esm-issue

Fixes #469 (by making a superset of the changes in that PR).

Potentially related to #458.

Checklist
  • npm test passes and has 100% coverage

Recent Node.js versions throw `ERR_REQUIRE_ASYNC_MODULE` instead of
`ERR_REQUIRE_ESM` if `require()` is used to import a module with top-
level await.
@mxxk
Copy link
Author

mxxk commented Oct 7, 2025

@seppevs can you please take a look? Without this fix, migrate-mongo is unusable on newer Node.js versions when top-level await is involved.

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.

1 participant