Magento2 is full of surprises and I am loving and hating it at the same time. I fix one issue and another issue comes up sooner or later.
Mostly, I have been using Ubuntu for Magento 2 development but I decided to try it on Windows to test the platform performance. Installation was nice and easy and I was able to install demo data without any issue.
After setting up the initial version, I decided to create my own extension which involved a few frontend templating. Everything was normal until I ran ‘php bin\magento setup:di:compile’. Screenshot below.
I was served with a fatal error and after scratching my head a few times – and of course hitting on the wall a few times, I decided to remove var/generation directory. It all went fine this time. Alright, so to cut the long store short, do the following:
STEPS:
- Don’t panic
- Take a deep breath
- Remove {magento_directory}/var/generation/
- Run ‘php bin/magento setup:di:compile’ again
Did it fix your issue? Leave a comment below to let others know :)
nope this is still not working
Worked for me, thanks!
Thanks for your comment Samul. I’m glad I could help.
Not fixed.
Hi there,
Could you tell me what error do you get and provide the steps to recreate it as well so I can replicate at my end.
Cheers
it doesn’t fix the issue
Hi Neeraj,
What version of Magento are you using? Can you confirm that you are running the latest stable version? Also, it’s worth deleting page_Cache, di, generation and cache from var/ directory. Once done, run setup upgrade again and that should fix the issue.