on order place the email contains the following error and does not display properly
CSS Inline Error: Warning: DOMXPath::query(): Invalid expression in .../vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269
How do I fix this?
checkouterrormagento2order-email
on order place the email contains the following error and does not display properly
CSS Inline Error: Warning: DOMXPath::query(): Invalid expression in .../vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269
How do I fix this?
Best Answer
This may be a bug of Emogrifier module.
Put this in the
require-dev
part ofcomposer.json
:Or prefer the development version:
There is a notice: seem that this issue also occurs when processing static content deploy.
UPDATE:
We should take a look:
vendor/magento/theme-frontend-blank/web/css/email.less
Magento email will import some less files. So, if we added some unsupported selectors to these files, that may cause this issue.
vendor/magento/theme-frontend-blank/web/css/source/_email-base.less
For example, in our custom theme, we add some unsupported selectors:
app/design/frontend/VendorTheme/default/web/css/source/_theme.less
This issue will occurs again.
SOLUTION:
We should create a new folder which contains the stand less files for our email styles. And, these files are only for email.
app/design/frontend/VendorTheme/default/web/css/email.less