magento2: Magento code generation bug, resulting in mails not sending!
Preconditions
- Have Magento 2.1.12 installed
- PHP 7.0.26
- MySQL 5.6
Steps to reproduce
- Install https://github.com/Bogardo/Mailgun-Magento2 extension
- Run setup:upgrade, di:compile and flush all cache
- Configure the extension
- Try and send a mail (order mail, invoice mail or any other mail)
Expected result
- The mail should send correctly
Actual result
- The mail does not send correctly, the following error is written to the logs:
2018-03-02 17:18:53] main.ERROR: Source class "\Nyholm\Psr7\Factory\Stream" for "Nyholm\Psr7\Factory\StreamFactory" generation does not exist. [] []
For some extra information see the following issues: https://github.com/mailgun/mailgun-php/issues/452 https://github.com/php-http/discovery/issues/105
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 16 (10 by maintainers)
Well,
is literally saying that the class does not exist.
By convention I mean that coding in Magento ecosystem you should know how classes like
Nyholm\Psr7\Factory\StreamFactory
are treated by Magento autoloader. This is described, for example, here: http://devdocs.magento.com/guides/v2.0/extension-dev-guide/factories.html#writing-factoriesI don’t see what can be fixed here on Magento side, as I described earlier https://github.com/Bogardo/Mailgun-Magento2 should not use non-Magento components like https://github.com/php-http/discovery directly, they should be wrapped in some custom factory or adapter in your module.