errors: add ERR_AMBIGUOUS_MODULE_SYNTAX message#60968
errors: add ERR_AMBIGUOUS_MODULE_SYNTAX message#60968Divya9877 wants to merge 2 commits intonodejs:mainfrom
Conversation
|
Hi maintainers 👋, This PR adds a test case for the new ERR_AMBIGUOUS_MODULE_SYNTAX error. 🔹 What I added A new test at: A new fixture at: 🔹 What the test does Uses the mixed-syntax fixture to simulate ambiguous ESM/CJS usage. Runs the module through Node. Asserts that Node throws the expected error code: Ensures the new error message is correctly triggered and validated. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #60968 +/- ##
==========================================
+ Coverage 88.45% 88.52% +0.06%
==========================================
Files 703 703
Lines 207546 208437 +891
Branches 40011 40200 +189
==========================================
+ Hits 183591 184524 +933
+ Misses 15949 15903 -46
- Partials 8006 8010 +4
🚀 New features to boost your workflow:
|
|
Tests are not passing, and the linked issue was closed as resolved. Closing for now, thanks for the PR. |
Summary
Adds an error message for ERR_AMBIGUOUS_MODULE_SYNTAX, which is used when a file mixes CommonJS and ES Module syntax.
Changes
Why
This improves developer experience by explaining that the file mixes CommonJS (require, module.exports) with ES Module features (import, export, top-level await) and suggests using a single module system consistently.