1

I'm experiencing a strange issue. On Prod/Preprod environment the application works fine but on dev environment (OSX) suddenly the application stopped working and we have no way to get it back on. We work on Magento 2.4.2-p1.

Inspecting the app, we see that the html file downloaded from the server doesn't include the theme.css. If we check the generated sources the file is there and if we set the same path as in prod, the file is loaded and look identical.

By some strange reason magento is not including the theme files (for both frontend and backend).

So far we tried to clean cache, copy the files from preprod to the local environment, reinstall nginx/php and set the permissions to the local user on the machine. Clear caches, reinstall vendor dependencies from composer, deploy static files,...

To bring more context: we're running nginx 1.21.0 and php-fpm 7.4.20.

Any ideas are welcome!

3
  • I have no clue about the problem here. Once I encountered a similar problem of not loading and JS. Tried various things and didn't help. Suddenly when I changed running mode from default to dev, and ran all commands like setup:upgrade, static-content:deploy c:f c:c etc it started working. I as a practice, I delete content of pub/static before run static-content:deploy. Jun 17 at 16:10
  • In my case, the JS loading looks fine as most of the dependencies are loaded by requiere.js. It's just the theme.css file that is not included in html. All the commands to clear cache and rebuild the static files have been issued and the contents of generated folders are also good. All files have 777 permissions and ownership of the same user that runs nginx and php-fpm. After cleaning cache and loading the page, all files still have the same permission. Honestly, I have no clue what's going on. After some brew update php changed from 7.4.16 to 7.4.20 but it worked for a while on that version.
    – Alex Roig
    Jun 17 at 16:59
  • Did you try cleaning up var/view_preprocessed/pub folder as well? And there is one more thing. In the database, check theme type is virtual or physical. It should be type should be 0. Jun 20 at 14:33
5

Edit that php.ini file and find the section [Pcre] and add this line at the bottom of that section :

pcre.jit=0

Restart your PHP

sudo brew services restart php@<PHP_VERSION>

3
  • Unfortunately I can only upvote once. I don't know if it did the trick but I changed the pcre settings, reconfigured nginx (I had it pointing to a VM that I setup to continue working on the meantime), cleared the /var/view_preprocessed, /var/generated and bin/magento c:f. Reloaded the page and it worked. Thanks!!
    – Alex Roig
    Jun 22 at 13:06
  • OMG I had the same issue - magento.stackexchange.com/questions/340107/… THANK YOU!
    – Goose84
    Jun 23 at 20:20
  • Many thanks , i got same error, but only you got
    – Adrian R
    Jul 6 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.