How to fix the «Invalid template file» / «require_js.phtml» failure of Magento 2.3.x in Windows?

bug
filesystem
windows
bug-fix
magento23
magento230
(Dmitry Fedyuk) #1

Replace the coe block:

with the following one:

$isWin = 'WIN' === strtoupper(substr(PHP_OS, 0, 3)); /** @var bool $isWin */
foreach ($directories as $directory) {
	if (0 === strpos($realPath, 
		!$isWin ? $directory : $this->fileDriver->getRealPath($directory))
	) {
0 Likes

How to fix the «Invalid template file» / «require_js.phtml» failure of Magento 2.2.7 in Windows?
(Dmitry Fedyuk) #2

See also: How to fix the «Invalid template file» / «require_js.phtml» failure of Magento 2.2.7 in Windows?

0 Likes

(Samair Ali) #3

hi tried it but still no success any other solution ?

0 Likes

(Samair Ali) #4

and i am using magento 2.3

0 Likes

(Dmitry Fedyuk) #5

It always work for me. Re-check your code.

0 Likes