Cz-cli: git-cz.js throwing error. Commit still goes through

Created on 4 Aug 2016  Â·  6Comments  Â·  Source: commitizen/cz-cli

Getting the following error after running git cz. version [email protected]

/node_modules/commitizen/dist/cli/strategies/git-cz.js:102
        throw error;

Commit seems to go through, however error doesn't provide much more details.

Most helpful comment

Ok, so this is what happend. With https://github.com/commitizen/cz-cli/commit/0d4e0d591cba474ae451ea53c9db9768257e202b#diff-23495cac1ee02ad0f5c48671e7498c16R69 I added nodeback error handling to the commit callback passed to commitizen adapters.

This was an error on my part – because the current, implicit contract between adapters and commitizen for the commit callback is (commitMessage) => void.

Fixing this now by typechecking arguments[0] in commit

All 6 comments

Hmm, that's no good... Ping @marionebl

@jaylaw81 could you provide more details?

  • OS
  • node and npm version
  • commitizen adapter in use
  • exact command executed
  • complete error printout

To make debugging for these cases easier we probably should attach stderr to the error object here: https://github.com/commitizen/cz-cli/blob/master/src/git/commit.js#L34

@marionebl I am seeing the same thing. My info is below. It doesn't look too helpful though. I have to call it a night, but if I have time later, I'll make the change locally to include stderr and look for more info.

  • OS: OS X El Capitan (10.11.6)
  • node: v6.3.1
  • npm: 3.10.3
  • adapter: cz-conventional-changelog
  • command: simply git-cz

Error output:

/Users/brandon/src/most-proxy/node_modules/commitizen/dist/cli/strategies/git-cz.js:102
        throw error;
        ^
fix(dependencies): Add most.js to devDependencies

most.js is a development dependency of most-proxy and is now automatically installed with the rest
of the development dependencies.



npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/Cellar/node/6.3.1/bin/node" "/usr/local/bin/npm" "run" "commit"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] commit: `git-cz`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] commit script 'git-cz'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the most-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     git-cz
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs most-proxy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls most-proxy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/brandon/src/most-proxy/npm-debug.log

One more bit of info: I experience the error with 2.8.4 and 2.8.3 but not with 2.8.2. Since 2.8.3 contains a single error-related fix, it seems likely the issue was introduced there.

@brandonpayton Thanks for the enhanced bug report, debugging this right now

Ok, so this is what happend. With https://github.com/commitizen/cz-cli/commit/0d4e0d591cba474ae451ea53c9db9768257e202b#diff-23495cac1ee02ad0f5c48671e7498c16R69 I added nodeback error handling to the commit callback passed to commitizen adapters.

This was an error on my part – because the current, implicit contract between adapters and commitizen for the commit callback is (commitMessage) => void.

Fixing this now by typechecking arguments[0] in commit

Was this page helpful?
0 / 5 - 0 ratings