All the emails received have the following error

CSS inlining error: Warning: DOMXPath::query(): Invalid expression in /home/73299-56608.cloudwaysapps.com/qamfwwvwxj/public_html/vendor/pelago/emogrifier/Classes/Emogrifier.php on line 269  

How can i resolve this error.

Check the attached image

enter image description here

  • How about your issue? Oct 12 '16 at 15:18
  • 1
    @KhoaTruongDinh, Well I solved it. by removing all unsupported css. Oct 13 '16 at 6:03
  • from where you remove the css which is unsupported? Apr 29 '19 at 8:02
  • @HafizArslan from the CSS that is included in email template, I have written some CSS(don't remember now the CSS) in app/design/frontend/Magento/luma/web/css/source/_email-extend.less which was causing the issue, there are few other LESS files from which email CSS is generated you have to check them all Apr 29 '19 at 8:30
  • what is your php version? May 2 '19 at 13:50

Magento email will import some default less files. So, if we added some unsupported selectors to these files, that may cause this issue: Order mail confirmation generates DOMXPath::query() error


The .less files are processed to produce inline CSS for emails. For some less selectors, the parsing fails due to special characters. Here is a solution which may work for you http://awebtech.blogspot.in/2016/10/css-inline-error-warning-domxpathquery.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.