Why Console.log and Debugger May Not Appear in Production (and How to Fix It in Slater)
Console.log statements and debugger commands may not appear in production builds due to JavaScript minification in Slater. Learn why this happens and how to disable minification in project settings to aid debugging.
When debugging production code in Slater, console output such as console.log statements or the use of debugger do not appear in your code. This occurs because Slater minifies your production JavaScript files by default. Minification removes whitespace and may also strip out debugging statements, making it difficult to trace issues using the browser console.
Why Does Minification Affect Debugging?
- Minification optimizes JavaScript by removing unnecessary characters and eliminating debug statements to reduce file size and improve load times.
- As a result,
console.loganddebuggerstatements are removed, making them invisible during runtime in production environments.
How to Disable Minification in Slater
To ensure that debugging statements remain available in your production build, minification can be turned off:
- Open your Slater project.
- Navigate to the project settings.
-
Uncheck the
Minify production filescheckbox.
4 Save your project settings and redeploy your production build.

Disabling minification will allow console.log and debugger statements to function as expected, making it easier to debug issues in production.
Slater uses Terser to handle file minification.
Additional Resources
- For more information about JavaScript minification and debugging practices, see:
- For video tutorials on debugging JavaScript:
Please refer to your Slater documentation for the latest updates on project settings and build configuration.