diff --git a/lib/setuplib.php b/lib/setuplib.php
index <HASH>..<HASH> 100644
--- a/lib/setuplib.php
+++ b/lib/setuplib.php
@@ -366,7 +366,7 @@ function default_exception_handler($ex) {
             if (AJAX_SCRIPT) {
                 // If we are in an AJAX script we don't want to use PREFERRED_RENDERER_TARGET.
                 // Because we know we will want to use ajax format.
-                $renderer = $PAGE->get_renderer('core', null, 'ajax');
+                $renderer = new core_renderer_ajax($PAGE, 'ajax');
             } else {
                 $renderer = $OUTPUT;
             }
MDL-<I> setuplib: safely construct the ajax renderer when needed