Is there anything wrong with keeping Magento 2 in Developer Mode?
-
11-10-2020 - |
سؤال
Anytime I switch to production mode, the system does not display the product images on the product pages. The wheel just keeps rotating. This only happens in production mode. I have compiled, flushed, deployed static content, flushed static content, everything.
But switching my Magento 2.1 (PHP 7.0) into production mode makes a spinning wheel for my product images on the product page, and, a spinning wheel after logging into the backend.
Don't even know where I can debug this or look for errors.
المحلول 2
Solution:
In case anyone else is having the same problem: the issue was not with production mode. Its the enabling of merging and compressing CSS and JS files on the backend. That was it. Its a known bug in Magento, and they are still working on this issue. I wish I didnt waste 3 weeks trying to figure this out !
نصائح أخرى
Keeping Magento in developer mode is not recommended. Instead I would recommend you to debug the issue until you find what is wrong and fixed it.
Keeping Magento in Developer Model will:
- Slow down the system as well the user experience since the static view files are not served from
pub/static
and instead generated every time a page is reloaded. - Display errors and exceptions to the users.
http://devdocs.magento.com/guides/v2.0/config-guide/bootstrap/magento-modes.html
Regarding the issue and for what you are saying it could be and issue related to the generation of the static content.
- Have you deployed the static content after switched to production mode?
- Do you get any warning/error when switch between modes or deploying the static content?
- Have you cleared cache?
- If you inspect the code in your browser after switch to production, can you spot any error?
- Is your web server well configured to serve those static files?
When deploying the static content, you can use -vv
at the end to get a more verbose output.
magento setup:static-content:deploy -vv
Hope this help you find/fix your issue and change your mind about keep your application running in developer mode.