Title: SCRIPT_DEBUG (breaks wp-admin with caching/CDN)
Last modified: September 11, 2025

---

# SCRIPT_DEBUG (breaks wp-admin with caching/CDN)

 *  Resolved [Christine](https://wordpress.org/support/users/weddingstyle/)
 * (@weddingstyle)
 * [9 months ago](https://wordpress.org/support/topic/script_debug-breaks-wp-admin-with-caching-cdn/)
 * Hello Wibowo,
   we love using Debug Log Manager for quick log handling. We’ve run
   into a reproducible issue in production:IssueWhen we enable error logging, the
   plugin also writesdefine(‘SCRIPT_DEBUG’, true);into wp-config.php. This makes
   WordPress load unminified development bundles in wp-admin (e.g., Rank Math). 
   In our environment with caching/CDN (BunnyCDN + WP Fastest Cache; Perfmatters
   currently disabled) and stricter headers, those dev bundles become fragile (timing/
   chunk loading), leading to console errors like __webpack_require__ is not defined/
   module is not defined, and our cookie banner fails to initialize.Why this shows
   up in our setupBecause of the caching/CDN layers, chunked dev assets loaded under
   SCRIPT_DEBUG = true are more sensitive. With SCRIPT_DEBUG = false, wp-admin is
   stable.ReproductionEnable logging in Debug Log ManagerThe plugin writes SCRIPT_DEBUG
   = true to wp-config.phpReload /wp-admin/ (e.g., Rank Math page) → admin assets
   break (errors above), cookie banner won’t loadWorkaroundManually restore SCRIPT_DEBUG
   to false → wp-admin is stable again. But the plugin may overwrite it the next
   time logging is toggled.Feature requestPlease add a way to enable WP_DEBUG / 
   WP_DEBUG_LOG without touching SCRIPT_DEBUG. For example:a checkbox “Do not modify
   SCRIPT_DEBUG” (default off), ora filter/constant the site owner can set, e.g.:
   if (apply_filters(‘dlm_modify_script_debug’, true)) {// only change SCRIPT_DEBUG
   when true}// or honor a guard:if (defined(‘SCRIPT_DEBUG_LOCK’) && SCRIPT_DEBUG_LOCK){/*
   do not change SCRIPT_DEBUG */ }We’re happy to provide headers/console screenshots
   or test a beta build.Thanks a lot!Christine
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fscript_debug-breaks-wp-admin-with-caching-cdn%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Bowo](https://wordpress.org/support/users/qriouslad/)
 * (@qriouslad)
 * [9 months ago](https://wordpress.org/support/topic/script_debug-breaks-wp-admin-with-caching-cdn/#post-18638661)
 * [@weddingstyle](https://wordpress.org/support/users/weddingstyle/) thanks for
   reporting this. I’ve just released v2.4.0 that adds an option at the bottom of
   the DLM dashboard to not modify SCRIPT_DEBUG when toggling error logging on/off.
   Please test.
 * If you find DLM useful for your work, please consider writing a quick review 
   for it at [https://wordpress.org/plugins/debug-log-manager/#reviews](https://wordpress.org/plugins/debug-log-manager/#reviews).
   Thank you.
 *  Thread Starter [Christine](https://wordpress.org/support/users/weddingstyle/)
 * (@weddingstyle)
 * [9 months ago](https://wordpress.org/support/topic/script_debug-breaks-wp-admin-with-caching-cdn/#post-18640389)
 * WOWWWWW! That was fast! Thank you so much for your help!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘SCRIPT_DEBUG (breaks wp-admin with caching/CDN)’ is closed to new replies.

 * ![](https://ps.w.org/debug-log-manager/assets/icon-256x256.png?rev=2783658)
 * [Debug Log Manager - Conveniently Monitor and Inspect Errors](https://wordpress.org/plugins/debug-log-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/debug-log-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/debug-log-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/debug-log-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/debug-log-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/debug-log-manager/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Christine](https://wordpress.org/support/users/weddingstyle/)
 * Last activity: [9 months ago](https://wordpress.org/support/topic/script_debug-breaks-wp-admin-with-caching-cdn/#post-18640389)
 * Status: resolved