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.


There are two modes: production and debug. By default, the Lightning Component framework runs in production mode. This mode is optimized for performance. It uses the Google Closure Compiler to optimize and minimize the size of the JavaScript code. The method names and code are heavily obfuscated.

When you enable debug mode, the JavaScript code isn’t minimized and is easier to read and debug. Debug mode also adds more detailed output for some warnings and errors.
Important

Important

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.

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.
    Note

    Note

    The Enable LockerService for Managed Packages setting lets you control whether LockerService is enforced for components installed from a managed package. The checkbox is only visible when the LockerService critical update is activated.