Recently I made my Magento 2.3.1 website live and set mode as "production". Now If I try to run php bin/magento setup:di:compile then it starts showing error

An error has happened during application run. See exception log for details.

In order to protect this I need to set Maintenance mode and website goes offline. Is it anyway by which we can run php bin/magento setup:di:compile and website will not show error.

Same thing happens during php bin/magento setup:upgrade. It distorted the page layout.

  • Yes it is in production mode Current application mode: production. (Note: Environment variables may override this value.) – Ankita Agrawal Nov 27 '19 at 12:39
  • ok wait am adding my ans! check it now – Pramod Nov 27 '19 at 12:39

Yes ofcourse there is.

First you just make it production skipping compilation.

php magento deploy:mode:set production --skip-compilation

Then, run

php bin/magento setup:di:compile

Voila, error will be shown. Try it.

| improve this answer | |
  • My webiste is already in production mode and if run php bin/magento setup:di:compile then it shows errors – Ankita Agrawal Nov 27 '19 at 12:35

This is a pretty old error that has not yet fixed by magento but in order to fix this you can follow these steps-

add the expected library from require-dev to require, giving a require setting in PhpCsFixerReview.php

"require": {
    "magento/product-community-edition": "2.0.5",
    "composer/composer": "@alpha",
    "sjparkinson/static-review": "~4.1"

hope this will solve your issue

| improve this answer | |
  • I am unable to find any file with name PhpCsFixerReview.php – Ankita Agrawal Nov 27 '19 at 12:54
  • me to cant find the file in directory – Munesh Jalwani Nov 27 '19 at 14:11
  • actually its a tool that automatically fixes all coding errors i think you are unaware of that – Pramod Nov 28 '19 at 5:02

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.