Skip to content

The "path" argument must be of type string. Received type undefined #734

Closed

Description

@fahimmahmoodmir

Issue description

Hi,

I am having a problem in running the package with the latest fix release of 4.1.1. I receive The "path" argument must be of type string. Received type undefined error whenever I try to run the package. I am using yarn as a package manager

Steps to reproduce the issue

  1. Run yarn git-cz

What's the expected result?

  • To run the command successfully

What's the actual result?

  • Error with The "path" argument must be of type string. Received type undefined (Image below)

image

Activity

  1. Wentong-Liu commented on May 5, 2020

    @Wentong-Liu

    same here.. can you guys please at least try for yourself and see if it's working before releasing a new version..

  2. hdmr14 commented on May 5, 2020

    @hdmr14
    Contributor

    it caused by changing default value of configLoader.load on 6ef8afa.
    related to #729

  3. LinusU commented on May 5, 2020

    @LinusU
    Contributor

    Really sorry about this, I definitively need to work on some things in order for this not to happen again:

    1. Setting up so that I always test the final version locally myself
    2. Improving the tests so that they catch this
    3. Understanding and documenting which code is part of the public api, and which aren't

    I have a fix up at #735 which I'll merge as soon as the CI is green, which should be in a few minutes.

    Again, sorry for the trouble this is causing!


    A small follow up on why I didn't catch this when testing locally:

    cz-conventional-changelog has a dependency on commitizen, so when I ran npm pack in my working copy of commitizen and then installed that in my test repo (npm install /path/to/pack.tar.gz) npm still kept another copy of commitizen installed in node_modules/cz-conventional-changelog/node_modules/commitizen. Since that copy was pulled from npm it wasn't using my local changes.

    The simple fix for this is to rm -r node_modules/cz-conventional-changelog/node_modules/commitizen which will make cz-conventional-changelog use the version of commitizen that I installed from npm pack. Unfortunately I didn't notice this until now.

    I really want to set up a test bench so that this can be done automatically. I know how to test it properly now, but it's very easy to miss, and it will be hard for new contributors to know.

    I hope that this gives some understanding to how the broken build made it's way out, and what we are doing to fix this in the future.


    So to recap, this is how to properly test it locally right now:

    1. Pack your local version
      npm pack
    2. Create an empty repo
      mkdir foo; cd foo; git init; echo {} > package.json
    3. Install you packed version of commitizen:
      npm install /path/to/pack.tgz
    4. Run the init command
      ./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact
    5. Remove the extra commitizen
      rm -r node_modules/cz-conventional-changelog/node_modules/commitizen
    6. Test a commit
      ./node_modules/.bin/git-cz
  4. LinusU commented on May 5, 2020

    @LinusU
    Contributor

    Released the fix as 4.1.2, I have also tested this version from npm and it works for me

    Please let me know if there are any more troubles, and sorry for the broken builds!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions