Skip to content

Conversation

@Divya9877
Copy link

Summary

Adds an error message for ERR_AMBIGUOUS_MODULE_SYNTAX, which is used when a file mixes CommonJS and ES Module syntax.

Changes

  • Registered ERR_AMBIGUOUS_MODULE_SYNTAX in lib/internal/errors.js with a clear explanatory message.

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.

@nodejs-github-bot nodejs-github-bot added errors Issues and PRs related to JavaScript errors originated in Node.js core. needs-ci PRs that need a full CI run. labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errors Issues and PRs related to JavaScript errors originated in Node.js core. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants