0

So, as the title says, css is not loading on my local Magento page.

I have used Valet, and Magento has been working fine up until today. Today, I wanted to try something and executed valet secure {magento}, where {magento} is the local name of the magento store I have set up. I got a 502 error after that, and fiddling around and searching a bit I fixed the 502 error by altering a buffer size setting in nginx.

When that got fixed, however, and the page loaded again, what did not load anymore was the css. I updated valet just in case, nothing changed. I removed magento and created a new site with a new name and reinstalled magento in the new folder, clearing the sql database first, it is the same. I cannot understand what changed, since valet secure only affects a single site, the problem should not have propagated to a brand new one.

I am on Linux Manjaro.
Magento version is 2.4.2.
Valet version is 2.2.26.
Nginx version is 1.20.0.
Php version is 7.18.

Any idea on why this happens and how this can be fixed will be appreciated.

If you need me to add anything to clarify the problem, let me know.

enter image description here

EDIT
bin/magento cache:disable : Disabled all caches
bin/magento set:up : All ok
bin/magento i:rei : All ok
bin/magento s:d:c : Successful
bin/magento s:s:d -f : Successful
bin/magento c:f : Successful (But cache is disabled anyway)

Problem still persists. I suspect this is a valet problem, since, when the problem occurred, nothing had changed on magento itself.

FURTHER EDIT
Turns out, nginx does not have something to do with the problem. Searching a bit, I found that on a new clean install of magento through composer, the core_config_data table in the db has only 28 rows out of a normal of 428 or so, with config about the theme and styles missing too, of course. So this whole matter is narrowed down on 3 suspects:

  • A problem with php being the latest 7 version, 7.4.20, since the latest update.
  • A problem with composer that does not download the needed packages - probably linked to new php 8 version, 8.0.7 (system has by default the 8 version, so composer was installed with php 8. Composer is run with php7 when downloading magento, and magento itself also runs with php 7, and valet too. This had not produced errors before, in fact there have been no php errors in any part of this).
  • Less likely - Magento messed up their own download sources and their downloads are corrupted. But I have not seen anyone else complaining about this.

If anyone can test on a system like mine and duplicate, please lend me some help.

Noob Doob
  • 127
  • 1
  • 9
  • did you run php bin/magento s:s:d -f command? – nhungo duc Jun 16 '21 at 10:55
  • php bin/magento s:up && php bin/magento i:rei && php bin/magento s:d:c && php bin/magento s:s:d -f && php bin/magento c:f – nhungo duc Jun 16 '21 at 10:57
  • @nhungoduc Updated the question – Noob Doob Jun 16 '21 at 11:06
  • https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html – nhungo duc Jun 16 '21 at 13:22
  • I see something that needs to be resolved first to be compatible with your magento 2.4.2 version – nhungo duc Jun 16 '21 at 13:23
  • @nhungoduc What do you see of these? It is important, and I have noted it in the question, that magento was working fine for weeks before, so I am not sure it is incompatibility of the installed software. – Noob Doob Jun 16 '21 at 13:35
  • @nhungoduc After consideration, maybe it is indeed a too new version of software responsible, as I did an update some time before the problem occured, but I had not restarted nginx immediately so the error did not occur immediately. I suspect nginx is to blame. – Noob Doob Jun 17 '21 at 12:29
  • i feel like magento upgrade to new version the system gets worse or something, i made a lot of mistakes when updating to the latest magento version – nhungo duc Jun 18 '21 at 02:36
  • See : https://magento.stackexchange.com/questions/339914/magento-doesnt-include-theme-css-in-html – Pascal LE MINH Jun 23 '21 at 15:29

0 Answers0