Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

peffraimidis's avatar

Call to a member function getRoutes() on array

Hello everyone, I am building a Laravel application which uses a Lumen API.

App Laravel Framework 5.8.18

API Laravel Framework Lumen (5.8.8) (Laravel Components 5.8.*)

This error suddenly appears in my log files and I can't find what triggers it.

This error is

[2019-09-07 13:03:11] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to a member function getRoutes() on array in Command line code:1
Stack trace:
#0 {main}
  thrown in Command line code:1
Stack trace:
#0 C:\Users\effraimidis\code\docker_sites\qr_api\vendor\laravel\lumen-framework\src\Concerns\RegistersExceptionHandlers.php(54): Laravel\Lumen\Application->handleShutdown()
#1 [internal function]: Laravel\Lumen\Application->Laravel\Lumen\Concerns\{closure}()
#2 {main} {"exception":"[object] (Symfony\Component\Debug\Exception\FatalErrorException(code: 1): Uncaught Error: Call to a member function getRoutes() on array in Command line code:1
0 likes
6 replies
mabdullahsari's avatar

You need to look deeper in the stack trace to catch that pesky bug.

I'm afraid noone can help you, since the information you've provided is very little.

peffraimidis's avatar

@mabdullahsari this is as deep as I can go. Or at least I think so This is the complete stack trace that it gets returned.

Tynael's avatar

I ran into the same issue.

Did you find a fix for it?

bewhy's avatar

If it was only yall... and its a PHP framework, should process only if listing/or processing resquests... Nope, here are some errors you dont know even who is executing them :D

matronator's avatar

Hi, I know this is an old thread, but for me the problem was caused by me forgetting to write a forward slash at the start of a route name in a group.

Please or to participate in this conversation.