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

feat: replace aggregate-error library with standard NodeJS AggregateError #43

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

trie-soptim
Copy link

In a new project I encountered problems in the interaction of this library and the latest version of Semantic-Release (23.0.5):

$ yarn release --dry-run
[08:56:28] [semantic-release] » ℹ  Running semantic-release version 23.0.5
[08:56:28] [semantic-release] » ✘  An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: require() of ES Module C:\<project-path>\node_modules\aggregate-error\index.js from C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js not supported.
Instead change the require of index.js in C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js:1:24) {
  code: 'ERR_REQUIRE_ESM'
}
Error [ERR_REQUIRE_ESM]: require() of ES Module C:\<project-path>\node_modules\aggregate-error\index.js from C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js not supported.
Instead change the require of index.js in C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (C:\<project-path>\node_modules\semantic-release-ms-teams\lib\lifecycle-verify-conditions.js:1:24) {
  code: 'ERR_REQUIRE_ESM'
}

As you can see in the log, it is not possible to import the library aggregate-error via require. This is no longer possible since version 4.0, as the library is delivered as a pure ESM package. Semantic-Release now uses version 5.0.0.

However, since NodeJS 15 it is possible to use the "native" AggregateError object. This change finally allows this library to be operated in the latest Semantic-Release version.

Fix #40

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

Successfully merging this pull request may close these issues.

Support semantic-release@21.0.2
1 participant