Can Anybody help me to resolve this error .
Class Magento\Framework\View\Element\Template\File\Validator does not exist
Please run below commands:
sudo chmod -R 0777 var/ pub/ generated/ php bin/magento setup:di:compile php bin/magento cache:flush
after giving appropriate permission to var,pub and generated folder we need to run di compile command so that class factory will generate in generated folder.
Hope this helps you.
If my answer is useful, please Accept as Solution & give Kudos
Shubham Khandelwal
You should put your complete code here. Seems like some code you are using does not have class
Magento\Framework\View\Element\Template\File\Validator
in your __construct method.
If you have then try in terminal-
rm -rf generated/code/*
After that
php bin/magento c:c
If yours is a production environment this may lead to system slowness for some time because the code needs to be written into generated.