This is a very common issue you will face if you using windows machine for development.
Usual error message is:
1 | Invalid template file: '/vendor/magento/module-theme/view/frontend/templates/page/js/require_js.phtml' in module: '' block 's name: ' require .js' |
So whats the solution?
In case of windows, just replace this function isPathInDirectories
in vendor/magento/framework/view/element/template/file/validator.php
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | protected function isPathInDirectories( $path , $directories ) { $realPath = str_replace ( '\\' , '/' , $this ->fileDriver->getRealPath( $path )); if (! is_array ( $directories )) { $directories = ( array ) $directories ; } foreach ( $directories as $directory ) { if (0 === strpos ( $realPath , $directory )) { return true; } } return false; } |
Reference:
https://magento.stackexchange.com/a/255585/32283
Leave a Reply