cancel
Showing results for 
Search instead for 
Did you mean: 

404 JS errors after installing

SOLVED

404 JS errors after installing

Hi all,

 

I just installed Magento 2.3.0 on Wamp server, following these steps: https://www.simicart.com/blog/install-magento-2-wamp/

 

I can't access neither the store or the admin website. For example, when I try to load the store website, here's what I get in the console: 

 

Could anyone help?

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Re: 404 JS errors after installing

Check this link: After installing magento 2.3 admin login page cant open properly

Find : /vendor/magento/framework/View/Element/Template/File/Validator.php:139find : 
foreach ($directories as $directory) {
    if (0 === strpos($realPath, $directory)) {
        return true;
    }
}

Replace with:
foreach ($directories as $directory) {    $realDirectory = $this->fileDriver->getRealPath($directory);
    // and replace `$directory` with `$realDirectory`
    if (0 === strpos($realPath, $realDirectory)) {
        return true;
    }
}

 

 

View solution in original post

5 REPLIES 5

Re: 404 JS errors after installing

Hi,

 

Install Magento 2 but do not use localhost use 127.0.0.1 in store URL and admin URL. After successful installation DO NOT run magento. Go to your root path and run

 

php bin/magento setup:static-content:deploy -f

If you get any error, check your PHP.EXE and PHP.INI Environment Variable

Clear / Flush Magento cache by typing “php bin/magento cache:flush” in CMD.

And finally, to Reindex Magento Static Blocks type “php bin/magento indexer:reindex”.

You are done with successful installation of Magento 2.

 

Thanks!!

 

 

Re: 404 JS errors after installing

Hi @Kavitha Mano

Thanks for the advice. This means I first have to remove both file system and DB structure/data, and then install again from the beginning, right?

 

Re: 404 JS errors after installing

you can give a try, 

command : php bin/magento setup:uninstall 

this will leaves you new instance

Re: 404 JS errors after installing

@Kavitha Mano I went through all the steps you wrote above.

Unfortunately, when I try to access to http://127.0.0.1/magento/, I still get errors in the console:

 

Curiously, all these errors are related to the require.js file

Re: 404 JS errors after installing

Check this link: After installing magento 2.3 admin login page cant open properly

Find : /vendor/magento/framework/View/Element/Template/File/Validator.php:139find : 
foreach ($directories as $directory) {
    if (0 === strpos($realPath, $directory)) {
        return true;
    }
}

Replace with:
foreach ($directories as $directory) {    $realDirectory = $this->fileDriver->getRealPath($directory);
    // and replace `$directory` with `$realDirectory`
    if (0 === strpos($realPath, $realDirectory)) {
        return true;
    }
}