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 husky pre-commit script is failing on committing changes. #2987

Closed
Suyash878 opened this issue Dec 28, 2024 · 4 comments
Closed

The husky pre-commit script is failing on committing changes. #2987

Suyash878 opened this issue Dec 28, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Suyash878
Copy link
Contributor

Suyash878 commented Dec 28, 2024

Describe the bug
Whenever we try to commit our staged changes, the husky pre-commit fails at:

[email protected] typecheck
tsc --project tsconfig.json --noEmit

When executed, This command fails and we see a number of type-check errors on the terminal.

To Reproduce
Steps to reproduce the behavior:

  1. Make some changes in any file.
  2. Stage those changes.
  3. Commit those changes.
  4. See the script failing at tsc --project tsconfig.json --noEmit

Expected behavior
The changes should be committed and no such error must be encountered.

Actual behavior
The script fails at [email protected] typecheck which leads to changes failing to commit.

Screenshots
image

Additional details
None.

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@Suyash878 Suyash878 added the bug Something isn't working label Dec 28, 2024
@Suyash878 Suyash878 changed the title The husky pre-commit is failing on commit changes. The husky pre-commit is failing on committing changes. Dec 28, 2024
@Suyash878 Suyash878 changed the title The husky pre-commit is failing on committing changes. The husky pre-commit script is failing on committing changes. Dec 28, 2024
@Suyash878
Copy link
Contributor Author

Suyash878 commented Dec 28, 2024

I have figured in the file 'VolunteerDeleteModal.spec.tsx' the issue was:

  • Here actually waitFor was imported from the library @testing-library/react initally.
    image
  • When instead it should've been imported from @testing-library/dom and render would still be imported from @testing-library/react
    image

I made these changes and re-ran the command, I did not come across any issues, However we will be required to install an additional package- @testing-library/dom to solve this issue.

After making the changes and re-running the command, the issue was resolved:
image

I have the changes made and I would like to work on this.

@Suyash878
Copy link
Contributor Author

I would like to work on this.

@PratapRathi
Copy link
Contributor

If you encounter with such issue, just run npm install it will refresh your node_modules and such error will be disappear.

@Suyash878
Copy link
Contributor Author

I tried that too, but it did not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants