When I try to change mode from developer to production a non-zero exit code is returned. I figured out it was not during deployment of static content, it was during compilation. memory_limit
is 2000M. I checked php bin/magento setup:di:compile
and found out that it stops and exits compilation at Repositories code generation...
without showing any error. I migrated the site to localhost, and now it successfully compiles and goes to production mode.
Why is it working in localhost, but fails in the online server?