Skip to content

Revert "fix: clean up ESM registry when require() of ESM module fails…#27325

Merged
Jarred-Sumner merged 1 commit intomainfrom
dylan/revert-27288
Feb 21, 2026
Merged

Revert "fix: clean up ESM registry when require() of ESM module fails…#27325
Jarred-Sumner merged 1 commit intomainfrom
dylan/revert-27288

Conversation

@dylan-conway
Copy link
Member

… (#27288)"

This reverts commit 21c3439.

@robobun
Copy link
Collaborator

robobun commented Feb 21, 2026

Updated 2:23 AM PT - Feb 21st, 2026

@dylan-conway, your commit ba4fc52 has 5 failures in Build #37857 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 27325

That installs a local version of the PR into your bun-27325 executable, so you can run:

bun-27325 --bun

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Modified error handling in CommonJS module loading to preserve Loader.registry entries on exception, and removed a regression test for module evaluation behavior involving CJS require() and ESM import() interaction.

Changes

Cohort / File(s) Summary
CommonJS Error Handling
src/js/builtins/CommonJS.ts
Modified exception handling in overridableRequire and requireESMFromHijackedExtension to preserve Loader.registry entries while removing only per-id require map entries on error.
Test Removal
test/regression/issue/27287.test.ts
Removed regression test verifying CJS require() and ESM import() behavior when an ESM module throws during evaluation.
🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It lacks the required 'What does this PR do?' and 'How did you verify your code works?' sections from the template. Add the missing template sections: explain why the previous fix is being reverted and describe verification steps taken (e.g., test results demonstrating the revert resolves issues).
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly indicates a revert operation of a specific commit related to ESM registry cleanup, directly reflecting the main changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Jarred-Sumner Jarred-Sumner merged commit b509acb into main Feb 21, 2026
5 of 30 checks passed
@Jarred-Sumner Jarred-Sumner deleted the dylan/revert-27288 branch February 21, 2026 09:14
@claude
Copy link
Contributor

claude bot commented Feb 21, 2026

ba4fc — Looks good!

Reviewed 2 files across src/js/builtins/ and test/regression/issue/: Reverts the ESM registry cleanup logic that was added when require() of an ESM module fails, along with its associated regression test for issue #27287.

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.

3 participants