question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

git-cz.js throwing error. Commit still goes through

See original GitHub issue

Getting the following error after running git cz. version commitizen@2.8.4

/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.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
marioneblcommented, Aug 5, 2016

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

1reaction
marioneblcommented, Aug 5, 2016

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Git is committing node_modules despite being ignored
One of the dependencies in my project uses chromium (which is over 100mb) and makes github throw an error when trying to push...
Read more >
lint-staged - npm
Linting makes more sense when run before committing your code. By doing so you can ensure no errors go into the repository and...
Read more >
Undoing Changes in Git | Atlassian Git Tutorial
Learn all of the available 'undo' Git strategies and commands with this tutorial. Undo changes helps you work with previous revisions of a...
Read more >
Error: failed to push some refs to – How to Fix in Git
This error mainly occurs when you attempt to push your local changes to GitHub while the local repository (repo) has not yet been...
Read more >
Git Hooks - Git SCM
The commit-msg hook takes one parameter, which again is the path to a temporary file that contains the commit message written by the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found