ERROR: Invalid template file: 'C:/xampp/htdocs/Project/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' In module: '' block's name: 'require.js'


Need to modify in core file.

Path : vendor\magento\framework\View\Element\Template\Validator.php

Method : isPathInDirectories (line no: 138)

Change : $realPath = $this->fileDriver->getRealPath($path); to $realPath = str_replace('\\', '/', $this->fileDriver->getRealPath($path));

Cause : Windows separator("\") and magento directories entries("/") are differ.

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.