There are 3 Magento 2 modes of operation that your system will be running on: developer, product, and default mode. This setting is configured in your app/etc/env.php file, which is the value of the ‘MAGE_MODE’ key.
Now we should know what each of the three Magento 2 modes does to your system. The developer mode, which is the mode you will be using most of the time, will display all exceptions, and undefined variables…
Running on developer mode, your system will also turn on code generation, which is needed for the system’s object system. Front-end files such as js, CSS, and template file generation will also be available.
In Magento 2 developer mode, uncaught exceptions will display in the browser
Running your system on developer mode will make your developing extensions on Magento 2 easier for sure. But when the customers want to deploy Magento on their server, they will be using production mode, which will hide MOST of the errors, and turn off code generation. When you switch from production to developer mode, you have to clear generated classes and objects in var/generation to prevent errors.
The default mode is the combination of the two above, which will suppress error messages but will turn on code generation. We don’t normally use this mode.
To switch Magento 2 modes, either edit the file in app/etc/env.php or use the command:
Php bin/magento deploy:mode:set <mode>
You might want to clean the cache after that:
Php bin/magento cache:clean
So that’s all information about the three modes of Magento 2 and how to switch between these modes that you should know. Don’t hesitate to reach out if you need additional details about our Magento development services, or want us to migrate your website to the powerful Magento eCommerce platform. Even in times of struggle with configuring our modules for your store, we will be at your service. Don’t forget that here at Magenest we guarantee remarkable quality services always available at a competitive price!