A route matching "array ( 'prefix' => 'Api', 'controller' => 'Admins', 'action' => 'login', 'plugin' => 'DebugKit', '_ext' => NULL, )" could not be found

I’m trying to make the default route into /Api/Admins/login whenever the project is opened using this route:

$builder->connect('/', ['prefix' => 'Api', 'controller' => 'Admins', 'action' => 'login']);

this is because my login function is in Controller/Api/Admins inside the AdminsController, and my login.php is also in template/Api/Admins. I’m using CakePHP 4 and I’m trying to follow the CMS tutorial Authentication in cookbook

Looks like this is happening from inside DebugKit, somehow. Without a stack trace or any other context to go on, all I can suggest would be to add 'plugin' => false to your URL array here.