Why Debug mode is required in LWC — June 11, 2021

Why Debug mode is required in LWC

HOW TO TURN ON DEBUG MODE IN YOUR ORG

  1. From Setup enter Debug Mode in the Quick Find box, and then select Debug Mode.
  2. Check the box next to your user.
  3. Click Enable.

WHAT HAPPENS WHEN DEBUG MODE IS NOT ENABLED

Lightning web components are compiled and minified. Minification makes them smaller and faster for the browser to load. But it also makes them challenging to troubleshoot. Minified code is especially hard to work with because line breaks are removed and variable names are changed. 

WHAT HAPPENS WHEN DEBUG IS ENABLED

This one step makes troubleshooting code much easier. Although the Lightning web components are still compiled, with Debug Mode enabled in the org, they’re not minified. So, the variable names remain the same and the general structure of the code remains, making it much easier to troubleshoot.

So , now you must have got clarity in why debug mode is actually required. Happy reading!!