Hi guys,
I am getting a blank page when trying to open a product detail page.
Magento 2 is able to get the product name and display it on meta title tag, but then the layout just stop rendering, so the final HTML is just blank <body></body>.
The product attributes is migrated from our previous Magento 1.9.3.7 website.
There is no issue on the admin site, we can see all the product information.
I have this issue on all Magento CE 2.0, 2.1, 2.2, and now 2.3.
You can see the issue on our development site: http://mage.thelightbulb.co.uk.
Any help would be greatly appreciated.
Hello @Hans K
To see an error on product page you can enable develop mode in Magento so error will show on frontend.
Run below command:
php bin/mageno deploy:mode:set developer
Hi Manish,
Thank you for replying.
But when I change into developer mode, I got this error:
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'body': This element is not expected. Expected is one of ( attribute, block, referenceBlock, referenceContainer, container, move, uiComponent ).
Line: 749
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'body': This element is not expected. Expected is one of ( attribute, block, referenceBlock, referenceContainer, container, move, uiComponent ).
Line: 749
#0 D:\vhosts\magento2\vendor\magento\framework\Config\Dom.php(117): Magento\Framework\Config\Dom->_initDom('<layout xmlns:x...')
#1 D:\vhosts\magento2\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(116): Magento\Framework\Config\Dom->__construct('<layout xmlns:x...', Object(Magento\Framework\App\Arguments\ValidationState), Array, NULL, 'D:/vhosts/magen...', '%message%\nLine:...')
Hello @Hans K
Run below command in root, grep -r -i --include \*.xml '<body' app/design/frontend/
You will find some xmls in the result and you can debug in these files, you will have body tag in related to proudct XML so you fix using these files.
Hi Manish,
I have tried to debug the XML layout files, but I did not found any incorrect ones, as I am still using the default Magento 2 theme and no additional extensions.
Hello @Hans K
Can you please try to run below commands once:
php bin/magento setup:upgrade php bin/magento setup:static-content:deploy -f php bin/magento cache:flush chmod -R 0777 var/ pub/ generated/
Hi Manish,
I have executed the suggested commands in order, but I am still getting the XML error on "developer" mode and the product detail page is still a blank page.
You can check the errors in the Magento log files and try to identify where the error occurs.
It may be the issue in your store migration and especially in the attribute section.
If you able to migrate attribute tables perfectly, it may fix your store issues
Hi @intellectbpo ,
Thank you for replying.
There is no errors in the debug.log, exception.log and system.log.
And based on the migration.log file, there is no issue on attributes migration.
On the admin site, we can see the product details (along with any custom attributes) without any issue.
Hi,
Same here, Have you solved your problem ?