node
node copied to clipboard
fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message
This PR improves the error message for ERR_AMBIGUOUS_MODULE_SYNTAX by dynamically identifying the CommonJS global that caused the ambiguity, instead of hardcoding 'require()'.
Fixes #60322
Review requested:
- [ ] @nodejs/loaders
Tests are not passing, there are conflicts, and the linked issue was closed as resolved. Closing for now, thanks for the PR.
Codecov Report
:x: Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 88.51%. Comparing base (e8c9c43) to head (9b0a95e).
:warning: Report is 28 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| lib/internal/modules/esm/module_job.js | 92.30% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #60949 +/- ##
==========================================
- Coverage 88.51% 88.51% -0.01%
==========================================
Files 703 703
Lines 208405 208405
Branches 40190 40193 +3
==========================================
- Hits 184468 184463 -5
- Misses 15941 15950 +9
+ Partials 7996 7992 -4
| Files with missing lines | Coverage Ξ | |
|---|---|---|
| lib/internal/modules/esm/module_job.js | 96.59% <92.30%> (ΓΈ) |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.