2

After uploading new theme files (Hebes) to Magento 2.3 installation I receive the following error:

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Backend::page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Backend::page/js/require_js.phtml' in module: 'Magento_Backend' block's name: 'require.js'
#0 /home/{site}/public_html/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView(false)
#1 /home/{site}/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml()
#2 /home/{site}/public_html/vendor/magento/framework/View/Result/Page.php(249): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 /home/{site}/public_html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#4 /home/{site}/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#5 /home/{site}/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MGS\Mpanel\Block\Framework\Page\Interceptor->___callParent('renderResult', Array)
#6 /home/{site}/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MGS\Mpanel\Block\Framework\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#7 /home/{site}/public_html/generated/code/MGS/Mpanel/Block/Framework/Page/Interceptor.php(39): MGS\Mpanel\Block\Framework\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#8 /home/{site}/public_html/vendor/magento/framework/App/Http.php(139): MGS\Mpanel\Block\Framework\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#9 /home/{site}/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#10 /home/{site}/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#11 {main}

require_js.phtml:

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
?>
<script>
    var BASE_URL = WEB_URL = '<?= $block->escapeUrl($block->getBaseUrl()) ?>';
    var RTL = false;
    var require = {
        "baseUrl": "<?= /* @escapeNotVerified */ $block->getViewFileUrl('/') ?>"
    };
</script>

edit: upon looking at this again i might need to mention that i have two sites/stores/views in the magento install, and base urls for the second have been changed prior to the uploading of the theme files. this theme was going to be used for the second store.

How do I go about fixing this error? Or should I use the "bypass/block" solution I see floating around from some of these "Invalid template file" errors?

thank you for any guidance

edit:

After trying the solution offered by Rakesh Donga, I was able to access the admin area but the frontend still showed the same error. I found in the admin area of content > design that the main website did not have a theme applied to it, I applied the Luma theme. the theme being installed, Hebes, was applied to the secondary site (subdomain) yet now the frontend of both sites have the following error:

1 exception(s):
Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::newletter-popup.phtml' in module: '' block's name: 'home.script'

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::newletter-popup.phtml' in module: '' block's name: 'home.script'
#0 /home/stradalli/public_html/vendor/magento/framework/View/Element/Template.php(301): Magento\Framework\View\Element\Template->fetchView(false)
#1 /home/stradalli/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(668): Magento\Framework\View\Element\Template->_toHtml()
#2 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(557): Magento\Framework\View\Element\AbstractBlock->toHtml()
#3 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(533): Magento\Framework\View\Layout->_renderBlock('home.script')
#4 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('home.script')
#5 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('home.script', false)
#6 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('page.wrapper', false)
#7 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
#8 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(585): Magento\Framework\View\Layout->renderElement('page.wrapper', false)
#9 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(535): Magento\Framework\View\Layout->_renderContainer('root', false)
#10 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(488): Magento\Framework\View\Layout->renderNonCachedElement('root')
#11 /home/stradalli/public_html/vendor/magento/framework/View/Layout.php(954): Magento\Framework\View\Layout->renderElement('root')
#12 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Layout->getOutput()
#13 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\View\Layout\Interceptor->___callParent('getOutput', Array)
#14 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\View\Layout\Interceptor->Magento\Framework\Interception\{closure}()
#15 /home/stradalli/public_html/generated/code/Magento/Framework/View/Layout/Interceptor.php(39): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#16 /home/stradalli/public_html/vendor/magento/framework/View/Result/Page.php(258): Magento\Framework\View\Layout\Interceptor->getOutput()
#17 /home/stradalli/public_html/vendor/magento/framework/View/Result/Layout.php(171): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#18 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#19 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(138): MGS\Mpanel\Block\Framework\Page\Interceptor->___callParent('renderResult', Array)
#20 /home/stradalli/public_html/vendor/magento/framework/Interception/Interceptor.php(153): MGS\Mpanel\Block\Framework\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#21 /home/stradalli/public_html/generated/code/MGS/Mpanel/Block/Framework/Page/Interceptor.php(39): MGS\Mpanel\Block\Framework\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#22 /home/stradalli/public_html/vendor/magento/framework/App/Http.php(139): MGS\Mpanel\Block\Framework\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#23 /home/stradalli/public_html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#24 /home/stradalli/public_html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))
#25 {main

Any advice is greatly appreciated.

  • After trying the solution offered by Rakesh Dongam did you try to run setup:upgrade and setup:static-content:deploy ? – fmsthird Feb 3 at 4:01
  • @magefms, i did. same results before and after, did a cache clean as well. – Justin Spencer Feb 3 at 6:06
  • No one is answering, on themeforest forum there is no answer too. They answered privately. – Sukhdevsinh Zala Jun 4 at 12:50

Your Answer

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

Browse other questions tagged or ask your own question.