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

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

Closed
fahimmahmoodmir opened this issue May 5, 2020 · 4 comments
Closed

Comments

@fahimmahmoodmir
Copy link

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

@Wentong-Liu
Copy link

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

@hdmr14
Copy link
Contributor

hdmr14 commented May 5, 2020

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

@LinusU
Copy link
Contributor

LinusU commented May 5, 2020

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

@LinusU
Copy link
Contributor

LinusU commented May 5, 2020

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!

@LinusU LinusU closed this as completed May 5, 2020
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

4 participants