Giter Site home page Giter Site logo

Comments (11)

jpoehnelt avatar jpoehnelt commented on July 1, 2024 3

Please test with version >= 1.2.6, https://www.npmjs.com/package/semantic-release-replace-plugin/v/1.2.6.

from semantic-release-replace-plugin.

karma-git avatar karma-git commented on July 1, 2024 1

Hello everyone!

I've returned to this plugin for bump python version via CI/CD but still couldn't make it :(
Sheck the error and my settings under the spoiler

@jpoehnelt , could you take a look, please?

spoiler

Error

bash-5.1# semantic-release
[2:09:07 AM] [semantic-release] › ℹ  Running semantic-release version 19.0.5
[2:09:08 AM] [semantic-release] › ✖  An error occurred while running semantic-release: Error: Cannot find module 'semantic-release-replace-plugin'
Require stack:
- /builds/infrastructure/playground/a.horbach/sermver-playground/noop.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at resolveFileName (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:43:9)
    at module.exports (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:46:47)
    at loadPlugin (/usr/local/lib/node_modules/semantic-release/lib/plugins/utils.js:51:82)
    at /usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:17:37
    at Array.reduce (<anonymous>)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:14:34)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-config.js:84:35)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/builds/infrastructure/playground/a.horbach/sermver-playground/noop.js'
  ]
}
Error: Cannot find module 'semantic-release-replace-plugin'
Require stack:
- /builds/infrastructure/playground/a.horbach/sermver-playground/noop.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:939:15)
    at resolveFileName (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:29:39)
    at resolveFrom (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:43:9)
    at module.exports (/usr/local/lib/node_modules/semantic-release/node_modules/resolve-from/index.js:46:47)
    at loadPlugin (/usr/local/lib/node_modules/semantic-release/lib/plugins/utils.js:51:82)
    at /usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:17:37
    at Array.reduce (<anonymous>)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/plugins/index.js:14:34)
    at module.exports (/usr/local/lib/node_modules/semantic-release/lib/get-config.js:84:35)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/builds/infrastructure/playground/a.horbach/sermver-playground/noop.js'
  ]

package:

bash-5.1# npm list -g
/usr/local/lib
+-- @google/[email protected]
+-- @semantic-release/[email protected]
+-- @semantic-release/[email protected]
+-- @semantic-release/[email protected]
+-- @semantic-release/[email protected]
+-- @semantic-release/[email protected]
+-- @semantic-release/[email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

My cfg:

{
  "branches": ["master", "feature/typer"],
  "tagFormat": "${version}",
  "plugins": [
    "@semantic-release/gitlab",
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "conventionalcommits",
        "releaseRules": [
          {"type": "breaking", "release": "major"},
          {"type": "feat", "release": "minor"},
          {"type": "docs", "release": false},
          {"type": "fix", "release": "patch"},
          {"type": "style", "release": false},
          {"type": "refactor", "release": false},
          {"type": "chore", "release": "patch"}
        ]
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "presetConfig": {
          "types": [
            {"type": "breaking", "section": "Breaking Change"},
            {"type": "feat", "section": "Feature"},
            {"type": "docs", "section": "Documentation"},
            {"type": "fix", "section": "Fix"},
            {"type": "style", "section": "Style"},
            {"type": "refactor", "section": "Refactoring"},
            {"type": "chore", "section": "Chore"}
          ]
        }
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "CHANGELOG.md"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": [
          "CHANGELOG.md"
        ],
        "message": "release: ${lastRelease.version} -> ${nextRelease.version}\n\n${nextRelease.notes}"
      }
    ],
    [
      "semantic-release-replace-plugin",
      {
        "replacements": [
          {
            "files": ["foo/__init__.py"],
            "from": "__VERSION__ = \".*\"",
            "to": "__VERSION__ = \"${nextRelease.version}\"",
            "results": [
              {
                "file": "foo/__init__.py",
                "hasChanged": true,
                "numMatches": 1,
                "numReplacements": 1
              }
            ],
            "countMatches": true
          }
        ]
      }
    ]
  ]
}

Dockerfile:

FROM alpine:3.18.2

RUN apk add --no-cache \
    git~=2.40\
    python3~=3.11.4 \
    py3-pip~=23.1.2 \
  && apk add --no-cache --virtual .build-deps \
    py3-cryptography~=40.0.2 \
  && pip install --no-cache-dir \
    black==23.3.0 \
    flake8==6.0.0 \
    bumpversion==0.6.0 \
    mkdocs-material==9.1.18 \
    mkdocs-mermaid2-plugin==0.6.0 \
    mkdocs-awesome-pages-plugin==2.9.1 \
    poetry==1.5.1 \
    pygments==2.15.1 \
    pylint==2.17.4 \
    twine==4.0.2 \
    wheel==0.40.0 \
  && apk del .build-deps

RUN addgroup --gid 10001 app \
  && adduser \
    --uid 10001 \
    --home /home/app \
    --shell /bin/ash \
    --ingroup app \
    --disabled-password \
    app

USER 10001

WORKDIR /home/app

ENTRYPOINT [ "" ]

from semantic-release-replace-plugin.

bigbrozer avatar bigbrozer commented on July 1, 2024

Same issue here using this plugin with 1.2.4 and Node 18.16.1.
Note: this is working properly when using the new version of @google/[email protected].

from semantic-release-replace-plugin.

BitFis avatar BitFis commented on July 1, 2024

Same issue here with [email protected] and Node v19.1.0

from semantic-release-replace-plugin.

bearkfear avatar bearkfear commented on July 1, 2024

Same issue here!

from semantic-release-replace-plugin.

xmnlab avatar xmnlab commented on July 1, 2024

+1

from semantic-release-replace-plugin.

karma-git avatar karma-git commented on July 1, 2024

I'm also looking for fix, thank you

from semantic-release-replace-plugin.

jpoehnelt avatar jpoehnelt commented on July 1, 2024

Is everyone using the plugin with the GitHub action, cycjimmy/semantic-release-action?

from semantic-release-replace-plugin.

karma-git avatar karma-git commented on July 1, 2024

no, I'm building my own pipeline in github-ci, but as guys mention above it does not work.
When I enable your module via .realease.json - semantic-cli crashes exactly like the issue author mention

from semantic-release-replace-plugin.

jpoehnelt avatar jpoehnelt commented on July 1, 2024

should be fixed with bef4c0a. I knew it had to be something super silly!

from semantic-release-replace-plugin.

TheSlimvReal avatar TheSlimvReal commented on July 1, 2024

With the latest version I am getting a new error

[9:28:45 AM] [semantic-release] › ℹ  Running semantic-release version 19.0.5
[9:28:46 AM] [semantic-release] › ✖  An error occurred while running semantic-release: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release-replace-plugin/dist/index.js from /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/utils.js not supported.
Error: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release-replace-plugin/dist/index.js from /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/utils.js not supported.
Instead change the require of index.js in /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/utils.js to a dynamic import() which is available in all CommonJS modules.
Instead change the require of index.js in /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/utils.js to a dynamic import() which is available in all CommonJS modules.
    at loadPlugin (/home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/utils.js:51:36)
    at /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/index.js:17:37
    at Array.reduce (<anonymous>)
    at module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/plugins/index.js:[14](https://github.com/Aam-Digital/ndb-core/actions/runs/5573981595/jobs/10181993405#step:4:15):34)
    at module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/lib/get-config.js:84:35)
    at async module.exports (/home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/index.js:265:32)
    at async release (/home/runner/work/_actions/cycjimmy/semantic-release-action/v3/src/index.js:30:[18](https://github.com/Aam-Digital/ndb-core/actions/runs/5573981595/jobs/10181993405#step:4:19)) {
  code: 'ERR_REQUIRE_ESM'

This might be because I am using Node version 14 as mentioned above.

from semantic-release-replace-plugin.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.