I'm in the process of migrating a Magento 2 install to AWS, and have been running into an issue when running the command:
php bin/magento setup:di:compile
When running the command, the compiling process stops at 44% and outputs the following errors:
In Generator.php line 140: Class Pelago\Emogrifier does not exist Class Bss\HtmlSiteMap\Model\Filter\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read- only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not g enerate properly, then you must add the generated class object to the signature of the related construct method, only.
Things I've tried:
And none of the above has worked. Any ideas would be greatly appreciated!
Verify whether the Namespace of the "Pelago\Emogrifier" class is accurate.
Afterward, confirm if the class aligns with the one stated within "Pelago\Emogrifier".
Rectifying the contextual namespace within `Pelago\Emogrifier` will effectively address the problem.
The error message you're encountering while running php bin/magento setup:di:compile in Magento 2 suggests that there's an issue with class generation, particularly related to the class Pelago\Emogrifier and the Bss\HtmlSiteMap\Model\Filter\Interceptor.
Here are some steps you can take to troubleshoot and resolve this issue:
Check for Missing Dependencies:
Check Autoloader Configuration:
Clear Generated Code:
rm -rf generated/* var/cache/*
Check File Permissions:
chown -R web-server-user:web-server-group generated var
Check for Compilation Errors:
Check for Missing/Deleted Files:
Magento Mode:
Third-Party Modules:
Magento Version Compatibility:
Logs and Debugging: