Skip to content

TypeError: AggregateError is not a constructor #7

Open
@ggarcia24

Description

@ggarcia24

Hello!

First let me thank you for this amazing plugin! 🤩, I was trying to configure semantic-release with a Java repository and, was trying to test this plugin but I encountered an error:

[6:19:26 PM] [semantic-release] › ✘  An error occurred while running semantic-release: TypeError: AggregateError is not a constructor
    at verifyConditions (REDACTED/node_modules/semantic-release-jira-notes/src/lib/verify-conditions.js:30:11)
    at async validator (REDACTED/node_modules/semantic-release/lib/plugins/normalize.js:36:24)
    at async REDACTED/node_modules/semantic-release/lib/plugins/pipeline.js:38:36
    at async Promise.all (index 0)
    at async next (REDACTED/node_modules/semantic-release/node_modules/p-reduce/index.js:15:44) {
  pluginName: 'semantic-release-jira-notes'
}
AggregateError: 
    TypeError: AggregateError is not a constructor
        at verifyConditions (REDACTED/node_modules/semantic-release-jira-notes/src/lib/verify-conditions.js:30:11)

This is my package.json:

{
  "name": "REDACTED",
  "version": "1.0.0",
  "scripts": {
    "semantic-release": "semantic-release"
  },
  "devDependencies": {
    "@commitlint/cli": "^19.5.0",
    "@semantic-release/changelog": "^6.0.3",
    "@semantic-release/git": "^10.0.1",
    "aggregate-error": "^5.0.0",
    "conventional-changelog-cli": "^5.0.0",
    "semantic-release": "^24.1.2",
    "semantic-release-commits-lint": "^1.1.0",
    "semantic-release-jira-notes": "^4.0.0"
  }
}

And this is my .releaserc.json:

{
  "debug": true,
  "plugins": [
    "@semantic-release/commit-analyzer",
    ["semantic-release-jira-notes", {
      "jiraHost": "REDACTED"
    }],
    "@semantic-release/changelog",
    "@semantic-release/git"
  ]
}

My best guess is that it's related to some changes over the module 'aggregate-error', as I'm not able to find AggregateErrorPromise class, but it might also have something to do with the migration to ESM, my main idea being that import() used to return a promise and now the import AggregateErrorPromise from "aggregate-error"; (on verify-conditions.js#L3 is not working in the same way

I might submit a PR later to attempt to fix it! But I wanted to check first in case I was missing something

Best regards
Gonzalo G

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions