Newer Version Available

This content describes an older version of this product. View Latest

Enable Debug Mode for Lightning Components

Enable debug mode to make it easier to debug JavaScript code in your Lightning components.
Available in: Salesforce Classic and Lightning Experience
Available for use in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions

Create Lightning components using the UI in Enterprise, Performance, Unlimited, Developer Editions or a sandbox.


The Lightning Component framework executes in one of two modes: production and debug.

Production Mode

By default, the framework runs in production mode. This mode is optimized for performance. Framework code is optimized and “minified” to reduce the size of the JavaScript code. As a result of this process, the JavaScript code served to the browser is obfuscated.

Optimization and minification are performed on framework code only. Custom component code is not minified or obfuscated. Untouched custom component code includes both components you create yourself, and components installed as part of a managed package.

Minification is a performance optimization, not intellectual property protection. Code that’s minified is hard to read, but it’s not encrypted or otherwise prevented from being viewed.

Important

Debug Mode

When you enable debug mode, framework JavaScript code isn’t minified and is easier to read and debug. Debug mode also adds more detailed output for some warnings and errors. As with production mode, custom component code is neither optimized nor minified.

Debug mode has a significant performance impact. The setting affects all users in your org. For this reason, we recommend using it only in sandbox and Developer Edition orgs. Don’t leave debug mode on permanently in your production org.

Important

To enable debug mode for your org:

  1. From Setup, enter Lightning Components in the Quick Find box, then select Lightning Components.
  2. Select the Enable Debug Mode checkbox.
  3. Click Save.