diff --git a/src/Console/CommandRunner.php b/src/Console/CommandRunner.php
index <HASH>..<HASH> 100644
--- a/src/Console/CommandRunner.php
+++ b/src/Console/CommandRunner.php
@@ -372,7 +372,9 @@ class CommandRunner implements EventDispatcherInterface
     {
         $builder = Router::createRouteBuilder('/');
 
-        $this->app->routes($builder);
+        if ($this->app instanceof HttpApplicationInterface) {
+            $this->app->routes($builder);
+        }
         if ($this->app instanceof PluginApplicationInterface) {
             $this->app->pluginRoutes($builder);
         }
Add check before calling methods that may not exist.