title: I keep getting this error on Slim 4 after installing new version 4.12
body: <p>I keep getting this error <code>Slim Application Error</code> after installing the new Slim 4 framework.</p>
  
  <p>I tried switching back to old version of slim but I keep getting the same thing.</p>
  
  <pre><code>&lt;?php
  use Psr\Http\Message\ResponseInterface as Response;
  use Psr\Http\Message\ServerRequestInterface as Request;
  use Slim\Factory\AppFactory;
  
  require __DIR__ . '/../vendor/autoload.php';
  
  /**
   * Instantiate App
   *
   * In order for the factory to work you need to ensure you have installed
   * a supported PSR-7 implementation of your choice e.g.: Slim PSR-7 and a supported
   * ServerRequest creator (included with Slim PSR-7)
   */
  $app = AppFactory::create();
  
  // Add Routing Middleware
  $app-&gt;addRoutingMiddleware();
  
  /*
   * Add Error Handling Middleware
   *
   * @param bool $displayErrorDetails -&gt; Should be set to false in production
   * @param bool $logErrors -&gt; Parameter is passed to the default ErrorHandler
   * @param bool $logErrorDetails -&gt; Display error details in error log
   * which can be replaced by a callable of your choice.
  
   * Note: This middleware should be added last. It will not handle any exceptions/errors
   * for middleware added after it.
   */
  $errorMiddleware = $app-&gt;addErrorMiddleware(true, true, true);
  
  // Define app routes
  $app-&gt;get('/hello/{name}', function (Request $request, Response $response, $args) {
      $name = $args['name'];
      $response-&gt;getBody()-&gt;write("Hello, $name");
      return $response;
  });
  
  // Run app
  $app-&gt;run();
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Slim Application Error
  The application could not run because of the following error:
  
  Details
  
  Type: Slim\Exception\HttpNotFoundException
  Code: 404
  Message: Not found.
  File: /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php
  Line: 91
  </code></pre>
  
  <p>Trace:</p>
  
  <pre><code>#0 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/Middleware/RoutingMiddleware.php(57): Slim\Middleware\RoutingMiddleware-&gt;performRouting(Object(Slim\Psr7\Request))
  #1 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/MiddlewareDispatcher.php(132): Slim\Middleware\RoutingMiddleware-&gt;process(Object(Slim\Psr7\Request), Object(Slim\Routing\RouteRunner))
  #2 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/Middleware/ErrorMiddleware.php(89): class@anonymous-&gt;handle(Object(Slim\Psr7\Request))
  #3 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/MiddlewareDispatcher.php(132): Slim\Middleware\ErrorMiddleware-&gt;process(Object(Slim\Psr7\Request), Object(class@anonymous))
  #4 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/MiddlewareDispatcher.php(73): class@anonymous-&gt;handle(Object(Slim\Psr7\Request))
  
  #5 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/App.php(206): Slim\MiddlewareDispatcher-&gt;handle(Object(Slim\Psr7\Request))
  #6 /opt/lampp/htdocs/MyocappAPI/vendor/slim/slim/Slim/App.php(190): Slim\App-&gt;handle(Object(Slim\Psr7\Request))
  #7 /opt/lampp/htdocs/MyocappAPI/public/index.php(41): Slim\App-&gt;run()
  #8 {main}
  </code></pre>