cancel
Showing results for 
Search instead for 
Did you mean: 

Magento shows blank page with error in console

SOLVED

Magento shows blank page with error in console

I hadn't touched my Magento installation in a couple of weeks and today I decided to try it out again. The frontpage worked OK, but when I tried to access the categories page on the admin it got stuck at the ajax loading. The Chrome console showed a bunch of css and js and loading errors. I deleted the folders /pub/static (except .htaccess) and var/view_preprocessed. Then I ran php bin/magento setup:static-content:deploy and php bin/magento setup:di:compile. After that the admin page for categories showed an error saying that setActive would not work on bool, which didn't make sense because I hadn't touched the magento code for categories. I went to the frontpage and it showed a blank page. View Source didn't reveal any errors, only the Chrome console shows the following error: "GET http://localhost/magento_test/%7B%7BMEDIA_URL%7D%7Dstyles.css net::ERR_ABORTED 404 (Not Found)"

I ran the commands:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f en_US el_GR
php bin/magento cache:clean
php bin/magento cache:flush

Still the same. Can anyone tell me what to do, and more importantly, what I did wrong? 2 weeks ago everything was working fine; last thing I did was try to run some unit tests, but I can't see how that could have broken the installation. I had also disabled 2 caches, which I re-enabled. Was it the di:compile command? Why?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento shows blank page with error in console

Hi @myrtopyrli9688,

 

Could you run this following command in order to check what is the issue that you're facing?

 

 

php bin/magento deploy:mode:set developer

 

 

Let me know if you need further assistance. 

 

Hope it helps!

_____________

If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert
Shopping Cart Migration Service

View solution in original post

3 REPLIES 3

Re: Magento shows blank page with error in console

Hi @myrtopyrli9688,

 

Could you run this following command in order to check what is the issue that you're facing?

 

 

php bin/magento deploy:mode:set developer

 

 

Let me know if you need further assistance. 

 

Hope it helps!

_____________

If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert
Shopping Cart Migration Service

Re: Magento shows blank page with error in console

I've run the command, and now it shows the page, except some .css and .js files don't load (there are errors in the console and some images are not showing). Should I run 

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

again?

I can't understand why setting developer mode should work, anyway. I was already in developer mode before running the command. I'd checked. Really can't understand Magento.

Re: Magento shows blank page with error in console

Hi @myrtopyrli9688,

 

The developer mode works because it's automatically regenerate files in generated. 

 

If you turn developer mode on without facing any issues, then you can switch back to production mode and run these following commands in sequence. 

 

chmod -R 777 var www generated
php bin/magento setup:static-content:deploy -f en_US el_GR
php bin/magento setup:di:compile
php bin/magento cache:clean
chmod -R 777 var www generated

 

Let me know if you need further assistance.

 

Hope it helps!

_____________

If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert
Shopping Cart Migration Service