I'm using Magento 2 CE Version 2.1.0

C:\wamp\www\magento2>C:\wamp\bin\php\php5.6.19\php.exe bin/magento setup:di:compile

Compilation was started.
%message% 0/7 [>---------------------------]   0% 1 sec 48.0 MiB%message% 0/7 [>---------------------------]   0% 1 sec 48.0 MiBProxies code generation... 0/7 [>---------------------------]   0% 1 sec 48.0 MiB
Proxies code generation... 1/7 [====>-----------------------]  14% 1 sec 50.8 MiB
Repositories code generation... 1/7 [====>-----------------------]  14% 1 sec 50.8 MiB

  Source class "\Custom\Module\Model\ResourceModel\Posts\PostsInterface" for "Custom\Module\Model\ResourceModel\Posts\PostsRepository" generation does not exist.


I'm trying to create Custom Admin CRUD.

  • Did you declare class Custom\Module\Model\ResourceModel\Posts\PostsInterface? Aug 19, 2016 at 5:57
  • the first thing that comes to mind is that your php ini is not set to have enough memory/time to execute the command. Have you tried running this commend with the verbose flag - bin/magento setup:di:compile -vvvv ?
    – circlesix
    Mar 19, 2017 at 2:47
  • what part of this error message leads you to think that it's an issue with memory? Mar 20, 2017 at 13:47

3 Answers 3


First you should run upgrade command and check your custom module has registered successfully. After that you should go for compilation.

Make sure /pub/static and /var folders have proper write permission (777).

  • It's Windows so no issues permission wise
    – Jackson
    Aug 19, 2016 at 9:32

Issue should be in the construct function. Either the arguments before array $data = [] needs to have some changes done, or the variables before parent::__construct($data); have some issues. You should post your code of constructor function.

Less reputation not allowing to comment

  1. Replace the Magento/Vendor folder from fresh copy.

  2. Assign the permissions

  3. Remove Var/Generation folder

  4. And compile again

This issue also occured for 2.1.5. Just replace the vendor folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.