Warning: include(/home/occ_vikas/occasionsjo.com/var/view_preprocessed/pub/static/vendor/magento/module-theme/view/base/templates/root.phtml): failed to open stream: No such file or directory in /home/occ_vikas/occasionsjo.com/vendor/magento/framework/View/Result/Page.php on line 327
-
Check with developer mode, Is it working or not. If not execute composer update– S.PCommented May 18, 2022 at 15:36
-
2Does this answer your question? This error has occured in magento 2, how can I fix it?– diazwatsonCommented Nov 29, 2023 at 15:01
-
I provided a potential fix for this issue here– diazwatsonCommented Nov 29, 2023 at 15:02
5 Answers
Simply deploy through CMD
php bin/magento setup:static-content:deploy -f
it will fix your error.
rm -Rf var/view_proccessed
rm -Rf var/cache
rm -Rf pub/static/frontend
php bin/magento setup:static-content:deploy -f
If it not works, tell us if all of madantory Magento 2 packages are installed.
And what's your Magento version ?
Try below commands:
php bin/magento setup:di:compile
rm -Rf var/view_proccessed
rm -Rf var/cache
rm -Rf pub/static/frontend
php bin/magento setup:static-content:deploy -f
php bin/magento c:f or php bin/magento cache:flush
Try to check if you work on some custom module, and add a bit of explanation.
Please run the below command first to remove var folder.
rm -rf var/page_cache var/cache var/composer_home var/generation var/di var/view_preprocessed
Rename composer.lock to composer.lock.bk file from root.
After that run below commands one by one.
composer install
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush