Magento 2.2.5 : Runtime Exception during setup:di:compile
-
25-01-2021 - |
Question
The issue started when I was attempting to enter production mode with
php bin/magento deploy:mode:set production
Upon researching the issue, I attempted to see if the error gave more information when I tried to compile without entering production mode.
Here is the error I received.
Any thoughts on the next steps I can take to resolve this? The ultimate goal is to be able to switch to production mode, but this compiling issue seems to be what is preventing me.
Solution
You are getting error during interceptor generation then this class should be referenced somewhere and doesn't actually exist. I think you may not have created object of this class that's why you don't know where the error is coming from. So, first you should search for the mention class and remove it's reference.
If you only need to set the store in production you can also just skip compilation by adding --skip-compilation param like below ;
php bin/magento deploy:mode:set production --skip-compilation