Closed karlomedallo closed 8 months ago
@semantic-release/gitlab was recently changed to ESM only. As #135 describes this is most likely the cause for your error. This package has to be migrated to ESM too, if you want to use v10 of @semantic-release/gitlab. Maybe try v9 and check whether it works with the previous version.
Same is happening with other parts of semantic-release, I guess this plugin needs to be updated to ESM to continue working...
[11:24:22 AM] [semantic-release] › ✘ Failed step "analyzeCommits" of plugin "[Function: semantic-release-monorepo]"
[11:24:22 AM] [semantic-release] › ✘ An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/circleci/repo/node_modules/@semantic-release/npm/index.js from /home/circleci/repo/node_modules/semantic-release-plugin-decorators/src/wrapStep.js not supported.
Instead change the require of index.js in /home/circleci/repo/node_modules/semantic-release-plugin-decorators/src/wrapStep.js to a dynamic import() which is available in all CommonJS modules.
at semantic-release-monorepo (/home/circleci/repo/node_modules/semantic-release-plugin-decorators/src/wrapStep.js:49:24)
at validator (file:///home/circleci/repo/node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///home/circleci/repo/node_modules/semantic-release/lib/plugins/pipeline.js:38:42
at next (file:///home/circleci/repo/node_modules/p-reduce/index.js:16:10) {
code: 'ERR_REQUIRE_ESM',
pluginName: '[Function: semantic-release-monorepo]'
}
Edit: Looks like there's a PR https://github.com/pmowrer/semantic-release-monorepo/pull/137
same problems.
[10:45:04 AM] [semantic-release] › ✘ An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/scene/scene/node_modules/@semantic-release/commit-analyzer/index.js from /home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js not supported.
Instead change the require of index.js in /home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js to a dynamic import() which is available in all CommonJS modules.
at semantic-release-monorepo (/home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js:49:24)
at validator (file:///home/runner/work/scene/scene/node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///home/runner/work/scene/scene/node_modules/semantic-release/lib/plugins/pipeline.js:[38](https://github.com/alovajs/scene/actions/runs/5411307043/jobs/9833872625#step:5:39):[42](https://github.com/alovajs/scene/actions/runs/5411307043/jobs/9833872625#step:5:43)
at next (file:///home/runner/work/scene/scene/node_modules/semantic-release/node_modules/p-reduce/index.js:16:10) {
code: 'ERR_REQUIRE_ESM',
pluginName: '[Function: semantic-release-monorepo]'
}
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/scene/scene/node_modules/@semantic-release/commit-analyzer/index.js from /home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js not supported.
Instead change the require of index.js in /home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js to a dynamic import() which is available in all CommonJS modules.
at semantic-release-monorepo (/home/runner/work/scene/scene/node_modules/semantic-release-plugin-decorators/src/wrapStep.js:[49](https://github.com/alovajs/scene/actions/runs/5411307043/jobs/9833872625#step:5:50):24)
at validator (file:///home/runner/work/scene/scene/node_modules/semantic-release/lib/plugins/normalize.js:36:30)
at file:///home/runner/work/scene/scene/node_modules/semantic-release/lib/plugins/pipeline.js:38:42
at next (file:///home/runner/work/scene/scene/node_modules/semantic-release/node_modules/p-reduce/index.js:16:10) {
code: 'ERR_REQUIRE_ESM',
pluginName: '[Function: semantic-release-monorepo]'
}npm ERR! Lifecycle script `release` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @alova/scene-vue@1.1.0
npm ERR! at location: /home/runner/work/scene/scene/packages/scene-vue
Error: Process completed with exit code 1.
Related issue in the @semantic-release/gitlab project: https://github.com/semantic-release/gitlab/issues/493
The solution appears to be downgrade to @semantic-release/gitlab v9 until semantic-release-monorepo is updated to support ESM. This worked for me.
@semantic-release/commit-analyzer
and @semantic-release/npm
also recently moved to ESM. You need to downgrade those to v9 too.
I created #138 to document which plugins need to be downgraded due to lack of ESM support in semantic-release-monorepo.
I published a new package semantic-release-monorepo-esm that supports esm. v1.0.10 should work without issues. The new package is based on the changes in this pr. https://github.com/pmowrer/semantic-release-monorepo/pull/143
@bryanjtc : Just wondering why don't you just start a new repo completely based on what you have done? I think it is awesome that you get to work on this. I really find that this repo is not really maintained. I'm actually looking at other solutions and migrating our codebase away from this
@bryanjtc : Just wondering why don't you just start a new repo completely based on what you have done? I think it is awesome that you get to work on this. I really find that this repo is not really maintained. I'm actually looking at other solutions and migrating our codebase away from this
I have been thinking to do that for a while now. The plan is to keep updating semantic-release-esm
to just support new semantic-release
versions. Easier to maintain that way. I also want to create new packages one as a config and another as a plugin for monorepos using semantic-release. These new packages can have new, maybe breaking features, such as support for dotnet and other feature requests from this repo.
@karlo-humanmanaged @jcapogna
We've released a monorepo package that's compatible with ESM, and since you have access to the source code, you're free to customize it as you wish. Cheers! 🍻
NPM package: https://www.npmjs.com/package/@rimac-technology/semantic-release-monorepo Source code: https://github.com/RimacTechnology/semantic-release-monorepo
:tada: This issue has been resolved in version 8.0.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
🎉 This issue has been resolved in version 8.0.0 🎉
Which issue?
Hi, I'm not sure if this error is from
semantic-release-monorepo
or from@semantic-release/gitlab
I have posted it here:
https://github.com/semantic-release/gitlab/issues/493
and here's the error: