Skip to content

fix: await ESM post-processing - #3200

Open
OskarEichler wants to merge 1 commit into
iamkun:devfrom
OskarEichler:codex/await-esm-postprocessing
Open

fix: await ESM post-processing#3200
OskarEichler wants to merge 1 commit into
iamkun:devfrom
OskarEichler:codex/await-esm-postprocessing

Conversation

@OskarEichler

Copy link
Copy Markdown

Breaking/build behavior changes

  • The ESM build now waits for all locale and plugin declaration rewrites before advancing or completing.
  • Rewrite/read/unlink failures now reach the existing top-level build error handler.
  • Runtime library behavior and generated module formats are unchanged.
  • PR fix: fail builds after generation errors #3195 separately makes the existing error handler return a non-zero process status.

Problem

Both ESM post-processing stages used forEach(async (...)). The returned promises were discarded, so type copying could race locale rewrites, the command could finish before plugin rewrites, and filesystem failures escaped as unhandled rejections.

Fix

Await both concurrent stages with Promise.all. Non-declaration plugin entries are filtered before processing.

Regression tests verify:

  • type copying waits for locale rewrites;
  • plugin rewrite failures reach the build error handler.

Verification

  • npm test — 94 suites, 796 tests passed
  • npm run lint
  • npm run babel — 184 files compiled and ESM post-processing completed
  • git diff --check

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