Troubleshooting `bin/packwerk validate` Failures: Common Causes

This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.

Message originally sent by slack user U71TN2WF04X

In what cases does bin/packwerk validate fail?
For the moment I found these three:

  1. Cyclic dependencies graph
  2. Unknown key in package.yml (example enforce_something: true will fail)
  3. List a non-existing package as a dependency
  1. Autoload clash (e.g. components/a/app/models/model.rb and components/b/app/models/model.rb bot defining Model)