The server.render() method does not work when used inside a request handler via request.server.render() when the view manager was created by a plugin. This is breaks because the request.server does not have access to the plugin realm where the view manager is configured (only has access to a view manager setup directly on the server root outside of any plugin).
The request.render() method works exactly the same way but it gets its realm from the route the request was bound to instead of the global server root.
Note that this will not work in onRequest extensions added by the plugin because the route isn't yet set at this point in the request lifecycle and the request.render() method will produce the same limited results server.render() can. If you need to call render() within onRequest, save a reference to the views manager direction from server.realm.plugins.vision.manager within the plugin and use that in the extension method.
The
server.render()method does not work when used inside a request handler viarequest.server.render()when the view manager was created by a plugin. This is breaks because therequest.serverdoes not have access to the plugin realm where the view manager is configured (only has access to a view manager setup directly on the server root outside of any plugin).The
request.render()method works exactly the same way but it gets its realm from the route the request was bound to instead of the global server root.Note that this will not work in
onRequestextensions added by the plugin because the route isn't yet set at this point in the request lifecycle and therequest.render()method will produce the same limited resultsserver.render()can. If you need to callrender()withinonRequest, save a reference to the views manager direction fromserver.realm.plugins.vision.managerwithin the plugin and use that in the extension method.