This is a tricky one and took me time to figure out... Installing a module defining JSON API resources during site install such as Commerce API can trigger a
RuntimeException: Recursive router rebuild detected.
exception.
This seems to be caused by the exceptions thrown from ResourceRoutes::ensureResourceImplementationValid()
by the following check:
elseif (empty($route->getDefault('_jsonapi_resource_types'))) {
throw new RouteDefinitionException("The $route_name route definition's _jsonapi_resource_types route default must declare at least one resource type.");
}
For some reason, during the installation, the following:
$order_resource_types = $this->getResourceTypesForEntityType('commerce_order');
returns an empty array causing the exception to be thrown which seems to trigger a router rebuild.
Closed: works as designed
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.