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

Time to upgrade semantic release? #211

Open
dafyddj opened this issue Oct 31, 2024 · 6 comments
Open

Time to upgrade semantic release? #211

dafyddj opened this issue Oct 31, 2024 · 6 comments

Comments

@dafyddj
Copy link

dafyddj commented Oct 31, 2024

Hi, is it time to upgrade the semantic-release package to the latest upstream version?

I had a problem recently with using an ESM packaged preset conventional-changelog-conventionalcommits

Thank you

@codfish
Copy link
Owner

codfish commented Oct 31, 2024

can you elaborate on what you were trying to do and what error you saw?

@dafyddj
Copy link
Author

dafyddj commented Nov 2, 2024

Configuration of

      - uses: codfish/semantic-release-action@9a999e0cdb207de2c9d9d4276860435727818989 # v3.4.1
        with:
          additional-packages: conventional-changelog-conventionalcommits
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

and a separate config file setting preset: conventionalcommits
Error

[7:40:11 PM] [semantic-release] › ✘  An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: require() of ES Module /github/workspace/node_modules/conventional-changelog-conventionalcommits/src/index.js from /github/workspace/noop.js not supported.
Instead change the require of index.js in /github/workspace/noop.js to a dynamic import() which is available in all CommonJS modules.
    at module.exports (/action/node_modules/import-from/index.js:5:100)
    at default (file:///action/node_modules/@semantic-release/commit-analyzer/lib/load-parser-config.js:25:74)
    at analyzeCommits (file:///action/node_modules/@semantic-release/commit-analyzer/index.js:31:24)
    at validator (file:///action/node_modules/semantic-release/lib/plugins/normalize.js:36:[30](https://github.com/dafyddj/tmp-winrepo-transform/actions/runs/11581228579/job/32241494076#step:5:31))
    at file:///action/node_modules/semantic-release/lib/plugins/pipeline.js:38:42 {
  code: 'ERR_REQUIRE_ESM',
  pluginName: '@semantic-release/commit-analyzer'
}
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module /github/workspace/node_modules/conventional-changelog-conventionalcommits/src/index.js from /github/workspace/noop.js not supported.
Instead change the require of index.js in /github/workspace/noop.js to a dynamic import() which is available in all CommonJS modules.

Workaround is to pin to an older version of conventionalcommits
additional-packages: [email protected]

No error seen when testing locally with the latest semantic-release version.

@dafyddj
Copy link
Author

dafyddj commented Nov 14, 2024

Any thoughts on this?

@codfish
Copy link
Owner

codfish commented Nov 15, 2024

@dafyddj yea, definitely time for an upgrade. I will work on it.

No error seen when testing locally with the latest semantic-release version.

Do me a favor, can you test locally using semantic-release v22 and node 20? Let me know if you get the same error

@dafyddj
Copy link
Author

dafyddj commented Nov 18, 2024

Hi, I've tried various versions back to node v20.12.1 and semantic-release v22.05 but I can't actually reproduce the error when testing locally 🤷🏻

@platoyuval
Copy link

I have the same issues.
Downgrading conventional-changelog-conventionalcommits to v7 solved the issue, as a workaround.

Please fix/upgrade the package to support conventional-changelog-conventionalcommits v8

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

3 participants