commit-analyzer icon indicating copy to clipboard operation
commit-analyzer copied to clipboard

The `analyzeCommits` plugin configuration is invalid. Your configuration for the analyzeCommits plugin is ``.

Open mklueh opened this issue 3 years ago • 1 comments

Hello,

I'm trying to get this plugin working, however I'm always running into the error

What I tried so far was the .releaserc.json and package.json config types with both having the same results:

[10:30:43 AM] [semantic-release] › ✖  EPLUGINCONF The `analyzeCommits` plugin configuration is invalid.
The analyzeCommits plugin configuration (https://github.com/semantic-release/semantic-release/blob/master/docs/usage/plugins.md#analyzecommits-plugin) is required and  must be a single or an array of plugins definition. A plugin definition is an npm module name, optionally wrapped in an array with an object.

Your configuration for the analyzeCommits plugin is ``.

AggregateError: 
    SemanticReleaseError: The `analyzeCommits` plugin configuration is invalid.
        at module.exports (/home/user/workspace/my-app/node_modules/semantic-release/lib/get-error.js:6:10)
        at /home/user/workspace/my-app/node_modules/semantic-release/lib/plugins/index.js:62:23
        at Array.reduce (<anonymous>)
        at module.exports (/home/user/workspace/my-app/node_modules/semantic-release/lib/plugins/index.js:47:59)
        at module.exports (/home/user/workspace/my-app/node_modules/semantic-release/lib/get-config.js:84:35)
        at async module.exports (/home/user/workspace/my-app/node_modules/semantic-release/index.js:265:32)
        at async module.exports (/home/user/workspace/my-app/node_modules/semantic-release/cli.js:55:5)
    at module.exports (/home/user/workspace/my-app/node_modules/semantic-release/lib/plugins/index.js:89:11)
    at module.exports (/home/user/workspace/my-app/node_modules/semantic-release/lib/get-config.js:84:35)
    at async module.exports (/home/user/workspace/my-app/node_modules/semantic-release/index.js:265:32)

This is my configuration

"dependencies": {
    "semantic-release": "^19.0.5",
    "conventional-changelog-conventionalcommits": "^5.0.0",
    "@semantic-release/changelog": "^6.0.1",
    "@semantic-release/commit-analyzer": "^9.0.2",
    "@semantic-release/exec": "^6.0.3",
    "@semantic-release/git": "^10.0.1",
    "@semantic-release/github": "^8.0.6",
    "@semantic-release/release-notes-generator": "^10.0.3",
},
"release": {
    "preset": "conventionalcommits",
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/changelog",
      [
        "@semantic-release/exec",
        {
          "publishCmd": "nx run affected --target=release --args=\"--version=${nextRelease.version}\""
        }
      ]
    ]
  },

What am I missing?

mklueh avatar Sep 25 '22 08:09 mklueh

I had the same issue. I was testing the setup, and the usage seemed to suggest that various stages/plugins could be executed, so I tried:

semantic-release --analyze-commits

And it failed with the same error as you mentioned. I had to debug to discover that there's supposed to be a second argument, which is a string. I found I had to use the analyzer plugin to make it work:

semantic-release --analyze-commits "@semantic-release/commit-analyzer"

I guess that these override the .releaserc.json configuration options. I was trying to do a dry-run of the local commits to see if it would bump as expected (I still haven't figured that out). Maybe that'll help you find the issue.

wickedest avatar Apr 19 '23 12:04 wickedest