Warning: DOMXPath::query(): Invalid expression in /opt/lampp/htdocs/magento/vendor/magento/framework/Config/Dom.php on line 273
Asked Answered
F

4

5

I am using Magento latest release 2.x.

Everything works fine, except when saving a product with an image Magento 2.x throws an error

Warning: DOMXPath::query(): Invalid expression in /opt/lampp/htdocs/magento/vendor/magento/framework/Config/Dom.php on line 273

I have just started learning Magento. any help would be appreciated.

Fahy answered 12/7, 2016 at 12:28 Comment(1)
I'm having same issue... perhaps you should post your question to magento.stackexchange.comInfallibilism
A
17

Though it is old question, there is no answer in 5 months. I got similar issue and found the cause for my case.

This issue might be generated due to wrong XML configuration. If you would add more code related to this issue, I probably could isolate the exact reason behind this issue.

At my end, I wrote di.xml wrongly, I didn't write root tag in di.xml. For that reason, this error would generate.

If anybody gets this issue, you should check your configuration files.

Audiphone answered 5/1, 2017 at 11:1 Comment(2)
That was exactly the cause of my problem: copy/pasting from posts missing the obvious parts.Yiyid
Great finding Agilox , I wish Magento displayed a better error!Blowtorch
H
2

The Main Problem Is your command line Is not Working...

And A Firstly Check Your Configuration File Before Not working any Idea Then Do this

This is Create an issue in Di.Xml File If you are only changing a Di.xml File Name Then Problem Solved

Highkey answered 13/5, 2020 at 14:30 Comment(0)
S
0

change current mode to developer and see the file which generating the error.

Satiable answered 26/3, 2018 at 16:50 Comment(1)
This is a helpful comment, but probably shouldn't be considered an answer.Pape
E
0

In my case, I missed to add the headers <config> of the di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
Enervated answered 4/10, 2023 at 5:45 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.