esm: improve ERR_REQUIRE_ASYNC_MODULE#64260
Open
joyeecheung wants to merge 1 commit into
Open
Conversation
Collaborator
|
Review requested:
|
Member
Author
|
@aduh95 @anonrig as explained in #64154 (comment) these changes were reverted during the landing of #64154 by mistake. Since you approved #64154 before the accidental revert, can you review this again? Thanks! |
1b62451 to
6ef0669
Compare
This brings back several improvements that were reverted by mistake when landing https://redirect.github.com/nodejs/node/pull/64154 - Update the documentation about how the removal of side effects of source collection - Add non-enumerable `requireStack` and `topLevelAwaitLocations` properties to `ERR_REQUIRE_ASYNC_MODULE`, the latter is only populated when --experimental-print-required-tla is enabled - Add "Required module: <url>" to the error message to identify the required ESM entry point regardless of whether the flag is enabled - Fix TLA caret column from 0-based to 1-based - Store module source via a private symbol instead of a public property - Use `hasAsyncGraph` (post-instantiation) in `throwIfAsyncGraph` instead of walking the graph before instantiation - Merge the require stack checking into the `common.expectRequiredTLAError` helper. - Removed tests that are made redundant by the snapshot tests Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
Member
Author
|
@mcollina Thanks for the review! I forced pushed again to sync up the Windows line ending normalization in the tests. Can you take a look again? |
anonrig
approved these changes
Jul 2, 2026
Collaborator
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #64260 +/- ##
==========================================
+ Coverage 92.01% 92.03% +0.01%
==========================================
Files 379 381 +2
Lines 166972 169161 +2189
Branches 25554 25919 +365
==========================================
+ Hits 153639 155687 +2048
- Misses 13041 13184 +143
+ Partials 292 290 -2
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This brings back several improvements that were reverted by mistake when landing #64154
requireStackandtopLevelAwaitLocationsproperties toERR_REQUIRE_ASYNC_MODULE, the latter is only populated when --experimental-print-required-tla is enabledhasAsyncGraph(post-instantiation) inthrowIfAsyncGraphinstead of walking the graph before instantiationcommon.expectRequiredTLAErrorhelper.