Skip to content

Conversation

@ST4RKJR
Copy link

@ST4RKJR ST4RKJR commented Dec 4, 2025

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

Dynamically identify the CommonJS global that caused the ambiguity.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. labels Dec 4, 2025
@aduh95
Copy link
Contributor

aduh95 commented Dec 10, 2025

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

@aduh95 aduh95 closed this Dec 10, 2025
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88.51%. Comparing base (e8c9c43) to head (9b0a95e).
⚠️ 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 ⚠️
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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the ERR_AMBIGUOUS_MODULE_SYNTAX error message

3 participants