conventional-changelog / releaser-tools

Create a GitHub/GitLab/etc. release using a project's commit messages and metadata.
MIT License
392 stars 34 forks source link

TypeError: Cannot read property 'replace' of undefined #191

Open bechir opened 4 years ago

bechir commented 4 years ago

Hi, I'm working on conventional-github-releaser 3.1.5, and i have the following error:

TypeError: Cannot read property 'replace' of undefined at ghGot (/path/to/project/node_modules/gh-got/index.js:32:58)

In my gulp configuration:

function githubRelease(done) {
    conventionalGithubReleaser({
            type: 'oauth',
            token: process.env.GH_TOKEN
        }, {
            preset: 'angular'
        },
        done
    );
}

exports.release = series(
    // ...
    githubRelease
);

Possible solution Update gh-got to ^9.0.0 ?

emptypockets-dev commented 3 years ago

I have the same problem. Any luck with a solution?

adotland commented 3 years ago

your opts object above is missing a value for the endpoint key, which is actually named 'url'

{url: 'https://api.github.com/'}

When not passed in, gh-got will check for it in your .env file, but this is irrelevant because it is overwritten by what you passed in earlier, which is undefined.

https://github.com/conventional-changelog/releaser-tools/blob/51fc1016b5bc893ad14014da23a4d1ba3d42048d/packages/conventional-github-releaser/src/index.js#L78

https://github.com/sindresorhus/gh-got/blob/a73bca816c09e7655f5f2496e0c4be4e6d204b09/index.js#L12