0

Keep getting this error in exception, no solutions to find on the internet:

DOMDocument::loadXML(): Argument #1 ($source) must not be empty in /vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php:32

I have seen some solution that says to remove empty file or remove space in XML file, but I don't seen any empty file,

This happened since I updated magento -> 2.4.5

So how to know which xml file it is

Thank You Harish

2 Answers 2

2

I fixed that issue by remove spacing at start of the xml file.

4
  • how you get that xml file? Commented Jun 1, 2023 at 12:09
  • 1
    Linux command for the file :- find /path/to/dest -type f -empty
    – MP Raj
    Commented Jun 1, 2023 at 12:18
  • Seems like this cmd use for find empty file not for finding spacing, right? Commented Jun 1, 2023 at 13:10
  • Right, It is for empty
    – MP Raj
    Commented Jun 1, 2023 at 13:24
1

Try this all steps

The error you're encountering indicates an issue with an empty source argument being passed to the loadXML() method of the DOMDocument class in the DomMerger.php file. This error is likely occurring during the XML parsing process in Magento after the update to version 2.4.5.

To identify the XML file causing the error, you can enable Magento's developer mode and configure it to display detailed error messages

1.Access your Magento installation via SSH or FTP.

2.Locate the index.php file in the root directory of your Magento installation.

3.Open the index.php file in a text editor.

4.Look for the following line:

  #ini_set('display_errors', 1);

5.After uncommenting the line, add the following code.

 ini_set('display_errors', 1);
  ini_set('display_startup_errors', 1);
  error_reporting(E_ALL);

6.Save the changes to the index.php file.

Now, when you visit your Magento store, you should see a detailed error message that includes the XML file causing the issue. The error message will display the file path along with the line number where the error occurs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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