node icon indicating copy to clipboard operation
node copied to clipboard

fix: improve ERR_AMBIGUOUS_MODULE_SYNTAX error message

Open ST4RKJR opened this issue 3 weeks ago β€’ 1 comments

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

ST4RKJR avatar Dec 04 '25 12:12 ST4RKJR

Review requested:

  • [ ] @nodejs/loaders

nodejs-github-bot avatar Dec 04 '25 12:12 nodejs-github-bot

Tests are not passing, there are conflicts, and the linked issue was closed as resolved. Closing for now, thanks for the PR.

aduh95 avatar Dec 10 '25 21:12 aduh95

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%> (ΓΈ)

... and 41 files with indirect coverage changes

: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.

codecov[bot] avatar Dec 10 '25 21:12 codecov[bot]