Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running semantic-release: ESM modules not supported in CommonJS #377

Open
mkbctrl opened this issue Dec 19, 2023 · 0 comments
Open

Comments

@mkbctrl
Copy link

mkbctrl commented Dec 19, 2023

When attempting to run semantic-release with the --dry-run flag, the process fails with an ERR_REQUIRE_ESM error. This error indicates that an ES Module is being require()'d in a CommonJS module, which is not supported. The specific module causing the issue is @semantic-release/changelog.

Error Output:

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/username/Software/project-x/project-x/node_modules/@semantic-release/changelog/node_modules/aggregate-error/index.js from /Users/username/Software/project-x/project-x/node_modules/@semantic-release/changelog/lib/verify.js not supported.
Instead change the require of index.js in /Users/username/Software/project-x/project-x/node_modules/@semantic-release/changelog/lib/verify.js to a dynamic import() which is available in all CommonJS modules.

Steps to Reproduce

  1. Run yarn semantic-release --dry-run in the terminal.

Expected Behavior
The semantic-release command should execute without errors and perform a dry run of the release process.

Environment

  • semantic-release version: 22.0.12
  • Node.js version: 20.9
  • Yarn version: 4.0.2
  • OS: Mac OS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant