- Issue created by @adancillo
- 🇫🇷France romainj
I have the same error with version 3.1.0:
LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\Core\Cache\CacheableJsonResponse. in Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (line 154 of /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).
This comes from the controller response:
opigno_learning_path/modules/opigno_user_selection/src/Controller/OpignoUserSelectionController.php
$response = new CacheableJsonResponse($response_data); $response->addCacheableDependency($meta);
I'm not sure what to do here to return a proper cacheable json response.