We have a vagrant setup for our magento 2 project. We have some custom modules in our setup. So on one linux machine there is no issue at all as we have same code (using git). But on mac machine same vagrant setup we are getting issue class do not exist while it does.
Exception #0 (InvalidArgumentException): Plugin class Magefan\LoginAsCustomer\Model\PageCache\ConfigPlugin doesn't exist
So you can see above exception for example while we have ConfigPlugin class file on right location. There is no issue when I am running setup:upgrade and setup:di:compile command mean there is no issue to generate file in pub folder.
And I have one more extension where magento redirecting on 404 page while on same url there is no issue on other linux machine. So after debugging the code I found magento is not able to found controller class file. Magento is able to read router.xml file but when it check controller class in following condition it return null.
is_subclass_of($this->actions[$fullPath], $this->actionInterface) ? $this->actions[$fullPath] : null;
So when I did var_dump on this full path $this->actions[$fullPath] then I can see the full path of controller file but if I check following condition in var_dump then it print false.
var_dump(class_exists($this->actions[$fullPath], true) );
So this mean magento is not able to find controller class file while it exist.
Please let me know if anyone faced same issue.