apptension / saas-boilerplate

SaaS Boilerplate - Open Source and free SaaS stack that lets you build SaaS products faster in React, Django and AWS. Focus on essential business logic instead of coding repeatable features!
https://apptension.com/saas-boilerplate
MIT License
2.13k stars 234 forks source link

Fresh project pre-commit issue #446

Closed matiasanaya closed 7 months ago

matiasanaya commented 8 months ago

Documentation is

Explain in detail

I ran pnpm create saas-boilerplate . and the immediately tried to run git commit -m "boilerplate: init saas-boilerplate" which failed with:

 Running pre-commit tasks πŸš€
βœ” Preparing lint-staged...
⚠ Running tasks for staged files...
  ❯ .lintstagedrc β€” 932 files (chunk 1/2)...
    ❯ *.{ts,tsx} β€” 343 files
      βœ– eslint --fix [FAILED]
    ❯ *.{json,md,html} β€” 95 files
      βœ– prettier --write [KILLED]
  ❯ .lintstagedrc β€” 931 files (chunk 2/2)...
    ❯ *.{ts,tsx} β€” 680 files
      βœ– eslint --fix [KILLED]
    ❯ *.{json,md,html} β€” 58 files
      βœ– prettier --write [KILLED]
↓ Skipped because of errors from tasks.
βœ” Reverting to original state because of errors...
βœ” Cleaning up temporary files...

βœ– eslint --fix:

Oops! Something went wrong! :(

...

husky - pre-commit hook exited with code 1 (error)

This can be fixed by running pnpm nx start webapp, maybe running pnpm install?

Your Suggestion for Changes

I'd suggest documenting this. At least for me is natural to commit the boilerplate starting state before running anything else.

mkleszcz commented 7 months ago

The issue is caused by: https://github.com/nrwl/nx/issues/20752 Basically @nx/enforce-module-boundaries eslint plugin throws an error when there is no NX graph generated. Starting webapp before first commit will call under the hood NX and generate the graph, this is why it's working after. It can be fixed also by calling other NX command, like: pnpm nx show projects.