0

I have developed a custom module and it is working fine in Magento 2.1.6 in my local system. But when am trying to enable my module in Magento 2.1.6 in my client's server then Magento throwing an error like:

Fatal error: Uncaught Magento\Framework\Exception\LocalizedException: Invalid Document Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 6 Element 'type': Character content other than whitespace is not allowed because the content type is 'element-only'. Line: 6 in /public_html/vendor/magento/framework/Config/Reader/Filesystem.php:160 Stack trace: #0 /public_html/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator)) #1 /public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader.php(69): Magento\Framework\Config\Reader\Filesystem->read('global') #2 /public_html/vendor/magento/framework/App/ObjectManager/Environment/Developer.php(77): Magento\Framework\App\ObjectManager\ConfigLoader->load('global') #3 /public_html/vendor/magento/framework/App/ObjectManagerFactory.php(1 in /public_html/vendor/magento/framework/Config/Reader/Filesystem.php on line 160

When trying to run setup:upgrade I got another error:

There are no commands defined in the setup namespace

I have searched many articles but unable to find the solution.

I am using PHP Version 7.0.21 and Magento 2.1.6.

Please help me to solve this.

2 Answers 2

0

Run the below command

php bin/magento list

Also check module.xml in your module.

0

First go to magento-root dirctory and remove, var/generation, var/cache, var/page_cache and view_preprocessed/

and also check you module.xml file have any spaces in top.

Then Run php bin/magento setup:upgrade

It will work fine, let me know if you have issue.

Your Answer

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

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