I am trying to generate html output of whole page and then pass it to response array.I am doing something like this:
$page = array( '#theme' => 'html', '#page_object' => new HtmlPage(render($content)), );
$content is a render array and new HtmlPage creates a HtmlPage object from an existing page. I am passing
render($page) to the response object, but I am getting error this error:
LogicException: A stray
$is_root_call = TRUEis causing bubbling of attached assets to break. in
Drupal\Core\Render\Renderer->doRender()(line 377 of core\lib\Drupal\Core\Render\Renderer.php).
What should I do to make this correct? Thanks